python - Python Chess:如何阻止 chess.engine.SimpleEngine.popen_uci() 打开 shell
问题描述
我正在制作自己的国际象棋 GUI,并为此使用 python 国际象棋和鱼。将其冻结为可执行文件后,每次调用时chess.engine.SimpleEngine.popen_uci('location\\of\\stockfish')
,它都会为 stockfish 打开 shell,如果我关闭 shell,stockfish 将停止工作。我该怎么做才能使外壳仅在后台运行并且对用户不可见?
解决方案
扩展@BoarGules 答案:
engine = chess.engine.SimpleEngine.popen_uci(sf,startupinfo = subprocess.STARTUPINFO(dwFlags=subprocess.STARTF_USESHOWWINDOW))
推荐阅读
- php - Laravel 中的多 JOIN 表
- c# - Microsoft Dynamics CRM 工作流教程不起作用
- python - 在 plotly 中设置条形图中的 x 和 y 范围
- python - matplotlib中带有叠加箭头的线图
- python - 输入()上的 EOFError
- android - 创建和维护android库
- mysql - 使用 GROUP BY 和 ORDER BY 优化计算中位数的查询
- vba - 在 Mac OSx 上使用 VBA 进行 Excel SQL 查询?
- r - 设置cookies和读取html
- eclipse - 日食火星中的这个橙色图标是什么意思?