Skip to content

Commit

Permalink
doc: add stdin to guide (#6531)
Browse files Browse the repository at this point in the history
<!--
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 #6481

```bash
$ uv run - <<EOF               
import antigravity
EOF
```

## Test Plan

<!-- How was it tested? -->


#6519 (comment) new PR
  • Loading branch information
billy-doyle authored Aug 23, 2024
1 parent 4cdca06 commit 3f147ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/guides/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ $ uv run example.py 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
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:
Expand Down

0 comments on commit 3f147ee

Please sign in to comment.