How can I "rich colorize" output sent to stdout.write ? #1589
Unanswered
ReddyKilowatt
asked this question in
Q&A
Replies: 1 comment 1 reply
-
There is a FileProxy class in Rich which is a file-like object which prints to the Console. You could replace your stdout with an instance of that, but you might have to tweak it to permit highlighting / markup. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
The Python cmd module
https://docs.python.org/3.6/library/cmd.html
has several methods which send output to stdout.write (which is aliased to sys.stdout) as in ....
self.stdout.write("some text")
I want to rich colorize a program that I'm writing but don't quite
understand how to use Console() with the cmd module, so that the self.stdout.write() calls will be colorized by Console()
Beta Was this translation helpful? Give feedback.
All reactions