Possible Duplicate:
How can I hide the console window in a PyQt app running on Windows?
当我在 Windows 中双击我的 pygame 应用程序 (.py) 时,所需的 pygame 窗口将打开,但始终会弹出一个空的终端窗口。我怎样才能防止这种情况发生?
最佳答案
将文件的文件扩展名从 .py
更改为 .pyw
。
参见Using the Python Interpreter :
2.2.2. Executable Python Scripts
The Python installer automatically associates
.py
files with python.exe so that a double-click on a Python file will run it as a script. The extension can also be.pyw
, in that case, the console window that normally appears is suppressed.
关于pygame 应用程序运行时弹出 Python 终端窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12121033/