thomasahle / sunfish

Sunfish: a Python Chess Engine in 111 lines of code
https://www.chessprogramming.org/Sunfish
Other
2.99k stars 548 forks source link

about using pypy #98

Closed tissatussa closed 1 year ago

tissatussa commented 1 year ago

most python3 scripts can be executed with pypy(3) as i understand .. i never had problems with it .. your README states :

An easy way to get a strong Sunfish is to run with with the PyPy Just-In-Time intepreter.

to me, this makes using pypy an option, but on top of ./sunfish.py i see this code line :

#!/usr/bin/env pypy3

does it mean pypy3 will always be used, even when i do $ python3 ./sunfish.py ? i don't understand - sometimes i even see a script which has no such header code at all .. maybe the extension .py is enough for the OS to run it properly ?

thomasahle commented 1 year ago

If you run the script with $ python3 ./sunfish.py (or $ python3 sunfish.py) the header is ignored. The header is only relevant if you want to run the script with $ ./sunfish.py. The later is useful when using sunfish with tools that expect a single executable (like cutechess-cli) rather than a full command with arguments.