Python terminal window popping up at pygame app run [duplicate]
-
28-06-2021 - |
Question
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?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow