I want to execute a KDB function within a Python Script. The KDB function is contained in a separate Q file though. So how can I read in this Q file and then query a function from within that Q file in Python?
You can use PyQ to call q into Python; a quick start guide is linked here . You can follow the instructions for installation and prompting q according to this link, then load in your script via the method shown in the example below.
Note: You should use the executable pyq rather than python to start.
$ pyq
>>> from pyq import q
>>> q()
q) \l /path/to/script.q
q) \
>>> x = q.f(arg1, arg2)
>>> x.show()
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With