问题
I'm trying to run a program without cmd window pop-up when I double click it or when I make it exe. So I wanted to save it as .pyw extension but when I double click to script, shell can't run it. It says I need to select the program to run it or search online. How can I fix this? Windows- Python 3.4
It was okay in 3.5 when I use .pyw extension. First time I see this problem.
回答1:
I always have this problem whenever I reinstall Python.
Very simple fix (at least on Windows):
1) Create a .pyw file
2) Right-click on it and select properties
3) In "Opens with:" press change
4) Navigate to your python directory and choose "pythonw.exe"
来源:https://stackoverflow.com/questions/37149454/python-pyw-extension-does-not-work