Issue 27980: Add better pythonw support to py launcher (original) (raw)

Created on 2016-09-06 19:00 by mark, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg274602 - (view) Author: Mark Summerfield (mark) * Date: 2016-09-06 19:00
The excellent py.exe launcher on Windows always uses a python.exe interpreter (although another issue suggests it will use pythonw.exe when the python file has a .pyw suffix which is good). However, if one wanted to provide a .bat file like this: @echo off pushd %~dp0 py -3 MyGuiApp.pyw %* popd python.exe would be used rather than pythonw.exe. My suggestion is to add a -w and/or --win(dows) flag which forces the use of pythonw.exe.
msg274603 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-09-06 19:01
pyw.exe is installed alongside py.exe, is it insufficient?
msg274606 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-09-06 19:09
py.exe is a console application. There's no point in using it to run pythonw.exe. Use pyw.exe, as Zachary suggests. Or better yet, just run `MyGuiApp.pyw %*`. Unless you've reconfigured the .pyw file association, it should run via pyw.exe.
msg274621 - (view) Author: Mark Summerfield (mark) * Date: 2016-09-06 20:41
Sorry, I didn't even know that pyw.exe existed. Naturally pyw -h produces no output, but maybe py -h could mention it?
msg274629 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-09-06 21:07
> Naturally pyw -h produces no output It needs help: `pyw -h 2>&1 | more`. This sets the StandardOutput and StandardError as the write end of a pipe. more.com reads from the pipe and pages the help text to the console. Maybe this needs a new issue to have `pyw -h` pop up a message box with the help text.
History
Date User Action Args
2022-04-11 14:58:35 admin set github: 72167
2016-09-06 21:07:13 eryksun set messages: +
2016-09-06 20:41:05 mark set messages: +
2016-09-06 19:09:59 eryksun set status: open -> closednosy: + eryksunmessages: + resolution: not a bugstage: resolved
2016-09-06 19:01:30 zach.ware set messages: +
2016-09-06 19:00:40 mark create