Skip to content

Python integration

Python integration requires embedPy

KX Developer has usability integrations with Python through the use of embedPy. If embedPy is installed in the kdb+ process Developer is running in, users can enable Python integration from the File > User Settings menu in Developer.

Once Python integration is enabled, and embedPy is installed and loaded (using \l p.q), the following integrations will be available.

Interactive editor

Any open .py or .p files in Developer are interactive in a similar way to regular q editors. At any point, Python text can be selected and run by using the editor context-menu or hotkey.

Move data between kdb+ and Python

Moving data between the q and Python execution environments can be done directly through the embedPy API, or through the Developer UI as follows:

In the Process View tab of the Developer sidebar, any selected data can be sent to the Python environment through the sidebar context-menu as seen below.

Editors

Once the Python integrations are enabled, expressions can be assigned to either execution environment through the use of the editor context-menus.

If in a q editor, select an expression or variable and select Set Variable in Python.

If in a Python editor, the same can be done to move data to q as seen in the interactive editor.

Python support FAQ

See the embedPy FAQ for information relating to Python support, particularly around data type compatibility between Python and q.