From 659600422aaf74d741a5edd9c777ddb253406db0 Mon Sep 17 00:00:00 2001 From: Skyler Kasko Date: Fri, 23 Aug 2024 23:32:12 -0400 Subject: [PATCH 1/2] doc: add example piping echo output to stdin --- docs/guides/scripts.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/guides/scripts.md b/docs/guides/scripts.md index df3df074edcc..c269c56da9fa 100644 --- a/docs/guides/scripts.md +++ b/docs/guides/scripts.md @@ -63,6 +63,14 @@ print("hello world!") EOF ``` +or + +```bash +echo ' +print("hello world!") +' | uv run - +``` + 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: From de0a96e5547713781b41c5e7dcc5ff503dfd3344 Mon Sep 17 00:00:00 2001 From: Skyler Kasko Date: Sat, 24 Aug 2024 00:24:32 -0400 Subject: [PATCH 2/2] doc: make echo pipe to stdin example a one-liner --- docs/guides/scripts.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/guides/scripts.md b/docs/guides/scripts.md index c269c56da9fa..1c931880163a 100644 --- a/docs/guides/scripts.md +++ b/docs/guides/scripts.md @@ -57,18 +57,16 @@ hello world! Additionally, your script can be read directly from stdin: -```bash -uv run - <