Skip to content
Discussion options

You must be logged in to vote

For anyone wondering, a way to do it is to just serve the rich console on a unix/tcp socket

# server.py
import socket
from rich.console import Console
from rich.live import Live
from rich.table import Table
from io import TextIOWrapper
import time

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('127.0.0.1', 10905))
server.listen(1)
conn, addr = server.accept()
file = conn.makefile(mode='wb', buffering=0)

console = Console(file=TextIOWrapper(file, write_through=True), width=40, force_terminal=True)

# rich.live example
table = Table()
table.add_column("Row ID")
table.add_column("Description")
table.add_column("Level")

with Live(table, console=console, refresh_per…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vladidobro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant