mirror of https://github.com/Textualize/rich.git
11 lines
273 B
Python
11 lines
273 B
Python
|
import io
|
||
|
|
||
|
from rich.console import Console, RenderableType
|
||
|
|
||
|
|
||
|
def render(renderable: RenderableType) -> str:
|
||
|
console = Console(width=100, file=io.StringIO(), color_system="truecolor")
|
||
|
console.print(renderable)
|
||
|
output = console.file.getvalue()
|
||
|
return output
|