I have a python script that runs successfully, with no errors or outputs to stderr or stdout, when run with pythonw from the console. However, if I try to open that script from file explorer using pythonw, it will exit in a few milliseconds.

I am using Windows 11, python 3.9.0.

A command such as "pythonw script.pyw" will work from the console, but the file can't be opened directly.

1

There are 1 best solutions below

0
On

There is a windows menu where you can select a default app per each filetype. I believe you could add the pythonw .exe file as the default app for .pyw files.

Hope this might help you

https://answers.microsoft.com/en-us/windows/forum/all/making-a-file-open-with-a-specific-program/9527cd74-565f-4331-a0e4-10e0a4cd618d