2

In python-chess you can communicate with the engine on a given position. However the method presented in https://python-chess.readthedocs.io/en/latest/uci.html using the engine.go() function with only a time parameter returns just one continuation and that continuations evaluation.

I know in most chess programs you can see the top few ranked positions and their evaluations. How can I do the same in python chess? None of the parameters in engine.go seemed to let me do that.

3

You can do this by sending out MultiPV, something like:

engine = chess.uci.popen_engine(...)
engine.setoption({ "MultiPV" : multiPV})

The module will generate multiple lines for you, as an array.

  • 1
    Short and simple! Gotta say, love how you and Phonon (like this recent stuff) among others are constantly providing code snippets in these answers, to encourage people to do a bit of scripting/programming on their own, and relying less on commercial-closed-source products. – user929304 Apr 11 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.