chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<!--[metadata]
|
||||
title = "Standard Input/Output example"
|
||||
thumbnail = "https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/480w.png"
|
||||
thumbnail_dimensions = [480, 298]
|
||||
-->
|
||||
|
||||
|
||||
<picture>
|
||||
<img src="https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/full.png" alt="">
|
||||
<source media="(max-width: 480px)" srcset="https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/480w.png">
|
||||
<source media="(max-width: 768px)" srcset="https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/768w.png">
|
||||
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/1024w.png">
|
||||
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/stdio/25c5aba992d4c8b3861386d8d9539a4823dca117/1200w.png">
|
||||
</picture>
|
||||
|
||||
Demonstrates how to log data to standard output with the Rerun SDK, and then visualize it from standard input with the Rerun Viewer.
|
||||
|
||||
```bash
|
||||
echo 'hello from stdin!' | python stdio.py | rerun -
|
||||
```
|
||||
@@ -0,0 +1,12 @@
|
||||
[project]
|
||||
name = "stdio"
|
||||
version = "0.1.0"
|
||||
readme = "README.md"
|
||||
dependencies = ["rerun-sdk"]
|
||||
|
||||
[project.scripts]
|
||||
stdio = "stdio:main"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
@@ -0,0 +1 @@
|
||||
rerun-sdk
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Demonstrates how to use standard input/output with the Rerun SDK/Viewer.
|
||||
|
||||
Usage: `echo 'hello from stdin!' | python main.py | rerun -`
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
import rerun as rr # pip install rerun-sdk
|
||||
|
||||
# sanity-check since all other example scripts take arguments:
|
||||
assert len(sys.argv) == 1, f"{sys.argv[0]} does not take any arguments"
|
||||
|
||||
rr.init("rerun_example_stdio")
|
||||
rr.stdout()
|
||||
|
||||
input = sys.stdin.buffer.read()
|
||||
|
||||
rr.log("stdin", rr.TextDocument(input.decode("utf-8")))
|
||||
Reference in New Issue
Block a user