Settings

Theme

Lazy self-installing Python scripts with uv

treyhunner.com

11 points by defulmere a year ago · 2 comments

Reader

d0mine a year ago

tldr: shebang that runs uv which understands https://peps.python.org/pep-0723/ to run Python script with dependencies installed on-the-fly (cached):

    #!/usr/bin/env -S uv run --script
    # /// script
    # requires-python = ">=3.12"
    # dependencies = [
    #     "ffmpeg-normalize",
    # ]
    # ///

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection