Sujet : Re: How to Add ANSI Color to User Response
De : grant.b.edwards (at) *nospam* gmail.com (Grant Edwards)
Groupes : comp.lang.pythonDate : 11. Apr 2024, 03:37:31
Autres entêtes
Message-ID : <mailman.93.1712803053.3468.python-list@python.org>
References : 1 2 3
User-Agent : slrn/1.0.3 (Linux)
On 2024-04-10, Alan Gauld via Python-list <
python-list@python.org> wrote:
On 10/04/2024 19: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
>
Normally, for any kind of fancy terminal work, I'd say use curses.
If you want to use the terminal escape sequences provided by terminfo
and ncurses, but don't want to use the ncurses windowing functions,
here are some notes on how to do that:
https://github.com/GrantEdwards/Python-curses-and-terminfoThat too is C-Python oriented, and I don't really know how to do the
same things using Jython.
-- Grant