uv/docs/reference
Rajko Radovanović f6f9179a5a
Add --gui-script flag for running Python scripts with pythonw.exe on … (#9152)
Addresses #6805

## Summary

This PR adds a `--gui-script` flag to `uv run` that allows running
Python scripts with `pythonw.exe` on Windows, regardless of file
extension. This solves the issue where users need to maintain duplicate
`.py` and `.pyw` files to run the same script with and without a console
window.

The implementation follows the pattern established by the existing
`--script` flag, but uses `pythonw.exe` instead of `python.exe` on
Windows. On non-Windows platforms, the flag is present but returns an
error indicating it's Windows-only functionality.

Changes:
- Added `--gui-script` flag (Windows-only)
- Added Windows test to verify GUI script behavior
- Added non-Windows test to verify proper error message
- Updated CLI documentation


## Test Plan

The changes are tested through:

1. New Windows-specific test that verifies:
- Script runs successfully with `pythonw.exe` when using `--gui-script`
- Console output is suppressed in GUI mode but visible in regular mode
   - Same script can be run both ways without modification

2. New non-Windows test that verifies:
- Appropriate error message when `--gui-script` is used on non-Windows
platforms

3. Documentation updates to clearly indicate Windows-only functionality

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-12-10 14:35:17 -06:00
..
policies Add policies reference section and license document (#9367) 2024-12-03 10:56:32 -06:00
benchmarks.md Add link to benchmarks in documentation (#6257) 2024-08-20 12:54:46 -04:00
build_failures.md Fix build failure links (#9740) 2024-12-09 09:31:34 -06:00
cli.md Add --gui-script flag for running Python scripts with pythonw.exe on … (#9152) 2024-12-10 14:35:17 -06:00
index.md Add policies reference section and license document (#9367) 2024-12-03 10:56:32 -06:00
resolver-internals.md Typo fixes (#9057) 2024-11-12 13:45:22 +00:00
settings.md Make check-url available in configuration files (#9032) 2024-12-02 17:30:12 -06:00