mirror of https://github.com/astral-sh/uv
doc: add stdin to guide (#6531)
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Document in guide stdin usage alllll the easter eggs can do as well, but declined to keep consistent with the other examples 😆 Additions to https://github.com/astral-sh/uv/pull/6481 ```bash $ uv run - <<EOF import antigravity EOF ``` ## Test Plan <!-- How was it tested? --> https://github.com/astral-sh/uv/pull/6519#issuecomment-2307371063 new PR
This commit is contained in:
parent
4cdca06db2
commit
3f147eeb06
|
|
@ -55,6 +55,14 @@ $ uv run example.py hello world!
|
||||||
hello world!
|
hello world!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Additionally, your script can be read directly from stdin:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv run - <<EOF
|
||||||
|
print("hello world!")
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
Note that if you use `uv run` in a _project_, i.e. a directory with a `pyproject.toml`, it will
|
Note that if you use `uv run` in a _project_, i.e. a directory with a `pyproject.toml`, it will
|
||||||
install the current project before running the script. If your script does not depend on the
|
install the current project before running the script. If your script does not depend on the
|
||||||
project, use the `--no-project` flag to skip this:
|
project, use the `--no-project` flag to skip this:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue