Skip to content

System Command Wrappers

pykx.system

System command wrappers for PyKX.

SystemCommands

SystemCommands(q)

Wrappers for q system commands.

More documentation on all the system commands available to q can be found here.

tables

tables(namespace=None)

Lists the tables associated with a namespace/dictionary

Examples:

Retrieve the tables within a provided namespace:

kx.system.tables('.foo')

Retrieve the tables within a provided dictionary:

kx.system.tables('foo')

cd

cd(directory=None)

Get the current directory or change the current directory.

Examples:

Get the current working directory.

kx.q.system.cd()

Change the current working directory to the root directory on a UNIX like machine.

kx.q.system.cd('/')

namespace

namespace(ns=None)

Get the current namespace or change to a new namespace.

Examples:

Get the current namespace.

kx.q.system.namespace()

Change the current namespace to .foo, note the leading . may be ommited.

kx.q.system.namespace('foo')

Return to the default namespace.

kx.q.system.namespace('')

functions

functions(ns=None)

Get the functions available in the current namespace or functions in a provided namespace or dictionary.

Examples:

Get the functions within the current namespace.

kx.q.system.functions()

Get the functions within the .foo namespace.

kx.q.system.functions('.foo')

Get the functions within a dictionary.

kx.q.system.function('foo')

load

load(path)

Loads a q script or a directory of a splayed table.

Examples:

Load a q script named foo.q.

kx.q.system.load('foo.q')

rename

rename(src, dest)

Rename file src to dest.

Equivalent to the unix mv command or Windows move command.

Note: Cannot rename to a different disk.

Examples:

Rename a file foo.q to bar.q.

kx.q.system.rename('foo.q', 'bar.q')

variables

variables(ns=None)

Get the variables in the current namespace or variables in a given namespace.

Examples:

Get the variables defined in the current namespace.

kx.q.system.variables()

Get the variables associated with a q namespace/dictionary

kx.q.system.variables('.foo')
kx.q.system.variables('foo')

workspace

workspace()

Outputs various information about the current memory usage of the q process.

Examples:

Get the memory usage of EmbeddedQ.

kx.q.system.workspace