Python Chess

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

chrisw
Posts: 4315
Joined: Tue Apr 03, 2012 4:28 pm

Python Chess

Post by chrisw »

Has anyone got the chess.engine function in Python Chess to work?

Mine gets here: chess.engine.SimpleEngine.popen_uci("stockfish")
finds stockfish in its directory, and then pumps out a load of internal errors and breaks before returning.

Windows 10, VS2017, python-chess 0.25.0

Code: Select all

# code as per Python Chess example code ....
import chess
import chess.engine

engine = chess.engine.SimpleEngine.popen_uci("stockfish")

board = chess.Board()
while not board.is_game_over():
    result = engine.play(board, chess.engine.Limit(time=0.100))
    board.push(result.move)

engine.quit()
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Python Chess

Post by Ferdy »

chrisw wrote: Sun Feb 17, 2019 1:25 pm Has anyone got the chess.engine function in Python Chess to work?

Mine gets here: chess.engine.SimpleEngine.popen_uci("stockfish")
finds stockfish in its directory, and then pumps out a load of internal errors and breaks before returning.

Windows 10, VS2017, python-chess 0.25.0
Upgrade to python-chess 0.25.1

https://python-chess.readthedocs.io/en/ ... gelog.html
chrisw
Posts: 4315
Joined: Tue Apr 03, 2012 4:28 pm

Re: Python Chess

Post by chrisw »

Ferdy wrote: Sun Feb 17, 2019 1:56 pm
chrisw wrote: Sun Feb 17, 2019 1:25 pm Has anyone got the chess.engine function in Python Chess to work?

Mine gets here: chess.engine.SimpleEngine.popen_uci("stockfish")
finds stockfish in its directory, and then pumps out a load of internal errors and breaks before returning.

Windows 10, VS2017, python-chess 0.25.0
Upgrade to python-chess 0.25.1

https://python-chess.readthedocs.io/en/ ... gelog.html
Thanks, done. Works.