How to Add ANSI Color to User Response
dn
PythonList at DancesWithMice.info
Wed Apr 10 17:43:37 EDT 2024
On 11/04/24 06:50, WordWeaver Evangelist via Python-list wrote:
> I have a simple question. I use the following textPrompt in some of my Jython modules:
> '\n[1;33mYour choice is? (A B C D E): ', maxChars=1, autoAccept=False, forceUppercase=True)
> Is there a way to add an ANSI color code to the end where the conditions are, so that the color of the user’s input is of a color of my choosing, instead of just white?
> Thank you very much in advance.
> Kind regards,
> Bill Kochman
Haven't tried using any of theses techniques, but may define input()
color, as well as print():-
How to print colored terminal text in Python
MAR 06, 2024
...
https://byby.dev/py-print-colored-terminal-text
--
Regards =dn
More information about the Python-list
mailing list