Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Is there a difference between python <script>.pyw and pythonw

121 views
Skip to first unread message

Eryk Sun

unread,
Apr 6, 2020, 3:15:33 PM4/6/20
to
On 4/5/20, Malcolm Greene <pyt...@bdurham.com> 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 inh
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|

Mike Dewhirst

unread,
Apr 6, 2020, 3:15:33 PM4/6/20
to
On 6/04/2020 8:35 am, Malcolm Greene wrote:
> Is there a difference between the following 2 ways to launch a console-less
script under Windows?
>
> python <script>.pyw
> pythonw <script>.py

I can't answer that but I can say that I schedule my local machine backup with
a python script. The only way I could get it working reliably was fully
specified ...

C:\Python37\python.exe\python.exe C:\Users\mike\utils\backup.py

Mike

>
> Thanks,
> Malcolm

David L Neil

unread,
Apr 6, 2020, 3:15:36 PM4/6/20
to
On 6/04/20 10:35 AM, Malcolm Greene wrote:
> Is there a difference between the following 2 ways to launch a console-less
script under Windows?
>
> python <script>.pyw
> pythonw <script>.py

Yes, but - or is it: no, but ...

Using Python on Windows
https://docs.python.org/3/using/windows.html

--
Regards =dn

0 new messages