Possible Duplicate:
How can I hide the console window in a PyQt app running on Windows?
When I double-click in Windows on my pygame app (.py) the desired pygame window opens, but always along with it, an empty terminal window pops up. How can I prevent this?
Change the file extension of your file from .py
to .pyw
.
See 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.
来源:https://stackoverflow.com/questions/12121033/python-terminal-window-popping-up-at-pygame-app-run