On 4/5/20, Malcolm Greene <[email protected]> wrote: > Is there a difference between the following 2 ways to launch a console-less > script under Windows? > > python <script>.pyw > pythonw <script>.py
The file extension is only a factor when the command line executes the script, not when it runs Python directly. The first case executes the script via python.exe, which inherits or allocates a console. The second case uses pythonw.exe, which does not inherit or allocate a console. The default file association for ".pyw" scripts runs the template command `"path\to\pyw.exe" "%1" %*`. "pyw.exe" is a GUI launcher that executes and waits on "pythonw.exe". The selected version depends on an active virtual environment and any "-X[.Y][-32|-64]" version specification passed on the command line or in the script's shebang. -- https://mail.python.org/mailman/listinfo/python-list
