can't execute pyw on windows

2019-08-09 05:38发布

问题:

I want to hide the console window of a python program, so I change the file extensions to "pyw", but when I open it, the python IDLE show up even though I choose open it with "pythonw.exe"

If I use "pythonw test.py" in cmd, it works.

So I want to know what's wrong with this and how to solve this, thank you.

回答1:

Change the program that opens python files.

Assuming you're using Windows, right click any python file (in your case any .pyw file, not .py), properties, change Opens with to pythonw instead of IDLE