This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add better pythonw support to py launcher
Type: enhancement Stage: resolved
Components: Windows Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eryksun, mark, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

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:35adminsetgithub: 72167
2016-09-06 21:07:13eryksunsetmessages: + msg274629
2016-09-06 20:41:05marksetmessages: + msg274621
2016-09-06 19:09:59eryksunsetstatus: open -> closed

nosy: + eryksun
messages: + msg274606

resolution: not a bug
stage: resolved
2016-09-06 19:01:30zach.waresetmessages: + msg274603
2016-09-06 19:00:40markcreate