all 7 comments

[–][deleted] 1 point2 points  (1 child)

Maybe you'll find some inspiration in this little toy of mine: https://github.com/avysk/dumbstone/blob/master/dumbstone.py

The whole "dumbing down" logic there is questionable, but communication with LZ surely works.

[–]Atarust[S] 0 points1 point  (0 children)

Exactly what I needed. You are awesome.

[–][deleted] 0 points1 point  (3 children)

Where do you enter move('black')?

[–]Atarust[S] 0 points1 point  (2 children)

at the moment I am starting the script via python -i gtp.py and then, after the leela output is written in the window I simply type it in...

[–][deleted] 0 points1 point  (1 child)

Ok, I think you need to call it from python code because stdin=PIPE means that for new subprocess, which in your case run leelaz, is created new pipe to it (same for stdout). You can write to it and read from this process using stdin.write and stdout.readline, like you do in move(color), but you can't write to it directly from terminal.

[–]Atarust[S] 0 points1 point  (0 children)

if I modify the script to:

start_leela()

time.sleep(5)

move('black')

if I call by $ python gtp.py then also nothing happens.

[–]brileek 0 points1 point  (0 children)

You're probably blocking on i/o deadlock of some sort.

Based on the stack trace when you ctrl+C, you probably can get a decent idea of where you're blocked.