Running scripts A Python script is a file intended for standalone execution, e.g., with python .py. Using uv to execute scripts ensures that script dependencies are managed without manually managing environments. Note If you are not familiar with Python environments: every Python installation has an environment that packages can be installed in. Typically, creating virtual environments is recommended to isolate packages required by each script. uv automatically manages virtual environments for you and prefers a declarative approach to dependencies. Running a script without dependencies If your script has no dependencies, you can execute it with uv run: example.pyprint("Hello world") $ uv run example.py Hello world Similarly, if your script depends on a module in the standard library, there's nothing more to do: example.pyimport os print(os.path.expanduser("~")) $ uv run example.py /Users/astral Arguments may be provided to the script: example.pyimport sys print(" ".join(sys.argv[1:])) $ uv run example.py test test $ uv run example.py hello world! hello world! Additionally, your script can be read directly from stdin: $ echo 'print("hello world!")' | uv run - Or, if your shell supports here-documents: run - 12,