Hello,
somebody wants to know : what is the meaning of python -u generally (in combination of a batch file)?
Could it be a connection between the Python.exe (Windows) and the commandline-parameter of an engine for an interface like Arena?
two examples are:
Shatranj https://github.com/stannous/shatranj
batch-file: python -u shatranj.py -xboard
Sunfish https://github.com/thomasahle/sunfish
batch-file: python -u xboard.py
Best wishes,
Norbert
Python argument -u
Moderators: hgm, Rebel, chrisw
-
- Posts: 1643
- Joined: Tue May 20, 2008 4:57 pm
- Location: Augsburg - Germany
-
- Posts: 433
- Joined: Fri Dec 16, 2016 11:04 am
- Location: France
- Full name: Richard Delorme
Re: Python argument -u
According to manpage:
So the -u command is necessary for the engine to read each (uci or cecp) command line by line, otherwise it will stay stuck until the buffer is full.
Code: Select all
- u Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put stdin, stdout and stderr in binary mode. Note that there is internal buffering in xreadlines(), readlines() and file-object iterators ("for line in sys.stdin") which is not influenced by this option. To work around this, you will want to use "sys.stdin.readline()" inside a "while 1:" loop.
Richard Delorme