You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is expected behavior. When you run pyq, q event loop is blocked in a call to Python's main loop. To avoid this, you should call python from a regular q session. For example:
Server side:
$ q
KDB+ 3.4 2016.06.14 ..
q)p)from pyq import q
q)p)def f(): print 'Hello';return q('42') # make sure to return a K object
q)p)q.f = f # export f to q (make sure not to delete f in python)
q)f() / check that we can call f locally
Hello
42
q)\p 1024 / now open the communication port
Client side:
$ q
KDB+ 3.4 2016.06.14 ..
q)`::1024 "f()"
42
and 'Hello' is printed on the server side.
If you don't want to prefix every line with p) you can put your python code in a file with .p extension and load it from q
KDB+/Q supports socket connection natively. But when activating the socket listener in Q, it will not response when inside PyQ.
Server Side:
Client Side:
The hopen command will wait for a long time, it seems the server side isn't responding.
The text was updated successfully, but these errors were encountered: