Pyq Server Connexion

Hello,

I am trying to use the fantastic PyQ package but I have trouble to connect to my Kdb database: I am trying without success this 

import pyq as q 

%%q hopen `:hostname:port:login:

tables

I do not need a password. It looks like what Qpad does right ? but for some reason I do not access to it. Someone has an idea of what I am doing wrong ?

Thx 

Best,

Hi A Im,
There is a few things you need to change in your code to get it to work.You should be using the PyQ kernel, then you won’t need to import q.You are also better to set your hopen to a variable as you will need to use it to get access to your port.Here is the code I got working

%%q
h:hopen `:hostname:port:login
h"tables[]"

Regards,
David

Hello,

Thank you for your answer. I forgot the h “”. It is a bit annoying to have to put those “” for each line.

I liked the q.Price approach from https://pyq.enlnt.com/slides/#/14. (Really convinient)

<o:p></o:p>

In our case it would be q.h(“Price”)

But I guess that is the way to do to access the data.

Thank you !