can't execute pyw on windows

Hunger picture Hunger · Feb 4, 2014 · Viewed 15.9k times · Source

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.

Answer

calccrypto picture calccrypto · Feb 4, 2014

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