Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/guides/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,25 @@ PS> uv run --with PyQt5 example_pyqt.pyw

![Run Result](../assets/uv_gui_script_hello_world_pyqt.png){: style="height:50px;width:150px"}

## Setting a shebang

You can use the following shebang (`#!`) line at the top of your script to have your system pick
`uv` for running it:

```python title="example.py"
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = []
# ///
```

You can then make the script executable and launch it without explicitly calling `uv`:

```bash
chmod +x example.py
./example.py
```

## Next steps

To learn more about `uv run`, see the [command reference](../reference/cli.md#uv-run).
Expand Down
Loading