Replies: 2 comments
-
I figured out that I can do this for line erasion: from rich import print as rprint
def erase_line():
print(f'\r{" " * (os.get_terminal_size().columns - 1)}', end='\r') I tried using my truncate function with the length of the tags added to that but It messes up the output. rprint(f'{counter} | https://ncore.pro/t/{id} | [bold #729c1f]{name}[/bold #729c1f]'[:truncate()+29], end="") |
Beta Was this translation helpful? Give feedback.
0 replies
-
See the docs on Live. It solves issues like hiding the cursor, wide characters, multiple lines, printing over the updating text. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently updating one of my tools and I have to rewrite lines a lot. With the built in print I could use:
What should I use instead of
\r
and how should I truncate lines considering the tags that will be in the f-strings?Beta Was this translation helpful? Give feedback.
All reactions