From ccadb1700e95da94bcd10e70ef9ff113c3a45750 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Wed, 13 Dec 2023 16:05:48 +0100 Subject: [PATCH] mention atty shenanigans + format --- examples/python/stdio/main.py | 7 ++----- rerun_py/rerun_sdk/rerun/sinks.py | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/python/stdio/main.py b/examples/python/stdio/main.py index 2c2beea4f322..480f2edfb73d 100755 --- a/examples/python/stdio/main.py +++ b/examples/python/stdio/main.py @@ -1,8 +1,5 @@ #!/usr/bin/env python3 -""" -Demonstrates how to log data to standard output with the Rerun SDK, and then visualize it -from standard input with the Rerun Viewer. -""" +"""Demonstrates how to use standard input/output with the Rerun SDK/Viewer.""" from __future__ import annotations import sys @@ -17,4 +14,4 @@ input = sys.stdin.buffer.read() -rr.log("stdin", rr.TextDocument(input.decode('utf-8'))) +rr.log("stdin", rr.TextDocument(input.decode("utf-8"))) diff --git a/rerun_py/rerun_sdk/rerun/sinks.py b/rerun_py/rerun_sdk/rerun/sinks.py index 68c3a00b28bb..63554653a2cd 100644 --- a/rerun_py/rerun_sdk/rerun/sinks.py +++ b/rerun_py/rerun_sdk/rerun/sinks.py @@ -76,6 +76,9 @@ def stdout(recording: RecordingStream | None = None) -> None: Call this _before_ you log any data! + If there isn't any listener at the other end of the pipe, the `RecordingStream` will + default back to `buffered` mode, in order not to break the user's terminal. + Parameters ---------- recording: