Thanks for the comments but I am still having issues retrieving all of the slave program's output. Commands have been highlighted for reference and the output of the slave program is in the normal text.
Here is an example command line session I am trying to duplicate.
Stockfish 2.1.1 JA by Tord Romstad, Marco Costalba and Joona Kiiski
uci
id name Stockfish 2.1.1 JA
id author Tord Romstad, Marco Costalba and Joona Kiiski
option name Use Search Log type check default false
option name Search Log Filename type string default SearchLog.txt
option name Book File type string default book.bin
option name Best Book Move type check default false
option name Mobility (Middle Game) type spin default 100 min 0 max 200
option name Mobility (Endgame) type spin default 100 min 0 max 200
option name Passed Pawns (Middle Game) type spin default 100 min 0 max 200
option name Passed Pawns (Endgame) type spin default 100 min 0 max 200
option name Space type spin default 100 min 0 max 200
option name Aggressiveness type spin default 100 min 0 max 200
option name Cowardice type spin default 100 min 0 max 200
option name Minimum Split Depth type spin default 4 min 4 max 7
option name Maximum Number of Threads per Split Point type spin default 5 min 4
max 8
option name Threads type spin default 2 min 1 max 32
option name Use Sleeping Threads type check default false
option name Hash type spin default 32 min 4 max 8192
option name Clear Hash type button
option name Ponder type check default true
option name OwnBook type check default true
option name MultiPV type spin default 1 min 1 max 500
option name Skill Level type spin default 20 min 0 max 20
option name Emergency Move Horizon type spin default 40 min 0 max 50
option name Emergency Base Time type spin default 200 min 0 max 30000
option name Emergency Move Time type spin default 70 min 0 max 5000
option name Minimum Thinking Time type spin default 20 min 0 max 5000
option name UCI_Chess960 type check default false
option name UCI_AnalyseMode type check default false
uciok
isready
readyok
position fen 8/4K3/4NN2/p3p3/rnp1p3/1pk5/bp1n4/qrb1N3 w
go
info depth 1
info depth 1 seldepth 1 multipv 1 score cp -4129 nodes 106 nps 1139 time 93 pv e
7d6
info nodes 106 nps 1139 time 93
bestmove e7d6
Here is the program that I am trying, which is based on your first example.
Code:
import subprocess as S
commands = ['uci', 'isready', 'position fen 8/4K3/4NN2/p3p3/rnp1p3/1pk5/bp1n4/qrb1N3 w', 'go']
proc = S.Popen('c:\stockfish.exe', stdin=S.PIPE, stdout=S.PIPE, bufsize=1, universal_newlines = True)
for i in commands:
proc.stdin.write(i + '\n')
print(proc.stdout.readline())
and here is the program output.
>>>
Stockfish 2.1.1 JA by Tord Romstad, Marco Costalba and Joona Kiiski
id name Stockfish 2.1.1 JA
id author Tord Romstad, Marco Costalba and Joona Kiiski
>>>
And now the question - why does my program output not match the command line output?