pygame 应用程序运行时弹出 Python 终端窗口

标签 python windows pygame windows-console

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/

相关文章:

Python Regex - 替换不在两个特定单词之间的字符串

python - 使用可变批量大小的 tf.contrib.layers.group_norm 的问题

python - 在 HappyBase 中使用多列过滤器

c++ - 将 SSL 客户端证书与 IXMLHTTPRequest3 一起使用

windows - Cygwin Bash.exe 与 mintty.exe

python - 列表索引超出范围,我不明白为什么?

python - 为什么我在运行 Python 时在 Spyder 中得到 "An error ocurred while starting the kernel"?

java - 如何从 Java 中查找并杀死正在运行的 Win-Processes?

python - 我如何将这个 (100, 100) numpy 数组转换为 pygame 中的灰度 Sprite ?

python - pygame中的 Sprite 掩码碰撞问题