Sujet : Re: How to Add ANSI Color to User Response
De : grant.b.edwards (at) *nospam* gmail.com (Grant Edwards)
Groupes : comp.lang.pythonDate : 10. Apr 2024, 20:53:20
Autres entêtes
Message-ID : <mailman.88.1712778802.3468.python-list@python.org>
References : 1 2
User-Agent : slrn/1.0.3 (Linux)
On 2024-04-10, WordWeaver Evangelist via Python-list <
python-list@python.org> 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?
I'm not sure what is meant by "the end where the conditions are", nor
do I know what "textPrompt" refers to.
Are you asking how to put a second escape sequence at the end of the
string literal after the colon?
-- Grant