You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the Windows 11 Task Scheduler to periodically run a Python script using the uv --quiet run command.
The script has the .pyw file extension, and uv correctly uses pythonw.exe to run the script without a console window.
Unfortunately, uv.exe itself still opens an empty console window. It stays open until it has parsed the inline metadata, checked the dependencies and started pythonw.exe. The window is both distracting and steals the focus.
It would be great, if there was an additional flag (e.g. --hidden, --no-console) to suppress the creation of the console window.
Alternatively, it may be possible to add this functionality to the --quiet flag.
The text was updated successfully, but these errors were encountered:
On a general level, you'd need to set the windows_subsystem attribute to "windows" so no console is provided by Windows to the application.
However, the issue then is
– as I understand it, this is why python.exe and pythonw.exe are entirely separate executables: python.exe has the subsystem set to CONSOLE, pythonw.exe has it set to WINDOWS (and respectively, .pyw files are associated with pythonw.exe).
https://stackoverflow.com/q/19168763/51685 touches on a Windows subsystem app being able to request a console, but the comments are somewhat worrisome ("invariably works poorly"...).
I am using the Windows 11 Task Scheduler to periodically run a Python script using the
uv --quiet run
command.The script has the
.pyw
file extension, anduv
correctly usespythonw.exe
to run the script without a console window.Unfortunately,
uv.exe
itself still opens an empty console window. It stays open until it has parsed the inline metadata, checked the dependencies and startedpythonw.exe
. The window is both distracting and steals the focus.It would be great, if there was an additional flag (e.g.
--hidden
,--no-console
) to suppress the creation of the console window.Alternatively, it may be possible to add this functionality to the
--quiet
flag.The text was updated successfully, but these errors were encountered: