I have a simple question. I use the following textPrompt in some of my Jython modules:
'\nYour 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 have a simple question. I use the following textPrompt in some of my Jython modules:
'\nYour 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
I have a simple question. I use the following textPrompt in some of my Jython modules:
'\nYour 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
Hello List,Over the years, I've tried different mechanisms for applying colors until
I have a simple question. I use the following textPrompt in some of my Jython modules:
'\nYour 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
I have a simple question. I use the following textPrompt in some of myHi Bill,
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?
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:
'\nYour 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.
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:
'\nYour 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.
But I suspect Jython may not support curses?
On the offchance it does do curses it would look like:
import curses
def main(scr):
if curses.has_colors(): # check the terminal supports color
curses.start_color(). # init the color system
curses.init_pair(1,curses.COLOR_YELLOW,curses.COLOR_BLUE)
# Now start adding text coloring as desired...
scr.addstr(0,0,"This string is yellow and blue",
curses.color_pair(1))
scr.refresh(). # make it visible
else: scr.addstr("Sorry, no colors available")
curses.wrapper(main)
HTH
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?
WordWeaver Evangelist <billkochman777@gmail.com> wrote or quoted:
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?
Now sonny, I ain't gonna give you a straight answer to your question,
but let me tell you what I know. You Windows users out there would
do well to look into that there "colorama" Python module! It'll help
you cook up them fancy ANSI escape sequences to get some color goin'
on in your Windows command prompt (or maybe even cross-platform).
Now, I can't rightly say if that's still needed these days or
if the new-fangled consoles even require it anymore. But if
you're hankerin' to add a little pizzazz to your text, that
colorama gizmo might just do the trick.
On 4/11/24 07:47, Stefan Ram wrote:
WordWeaver Evangelist <billkochman777@gmail.com> wrote or quoted:This answer seems rather insulting.
Is there a way to add an ANSI color code to the end where theNow sonny, I ain't gonna give you a straight answer to your question,
conditions are, so that the color of the user's input is of a
color of my choosing, instead of just white?
but let me tell you what I know. You Windows users out there would
do well to look into that there "colorama" Python module! It'll help
you cook up them fancy ANSI escape sequences to get some color goin'
on in your Windows command prompt (or maybe even cross-platform).
Now, I can't rightly say if that's still needed these days or
if the new-fangled consoles even require it anymore. But if
you're hankerin' to add a little pizzazz to your text, that
colorama gizmo might just do the trick.
Normally, for any kind of fancy terminal work, I'd say use curses.My problem with curses is that it takes over the whole terminal - you
Over the years, I've tried different mechanisms for applying colors until
I got my hands on f-stings; then I created a tiny module with all the
colors (cR, cG, etc) which made my life so much simpler (attached).
Pierre Fortin wrote:
Over the years, I've tried different mechanisms for applying colors until
I got my hands on f-stings; then I created a tiny module with all the
colors (cR, cG, etc) which made my life so much simpler (attached).
Attachments are stripped off in this list.
It would be nice to see this tiny module of yours.
An URL or attach as inline text please.
rthiebaud <geodandw@aol.com> wrote or quoted:
On 4/11/24 07:47, Stefan Ram wrote:Could you explain how exactly you came to this conclusion?
WordWeaver Evangelist <billkochman777@gmail.com> wrote or quoted:This answer seems rather insulting.
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 aNow sonny, I ain't gonna give you a straight answer to your question,
color of my choosing, instead of just white?
but let me tell you what I know. You Windows users out there would
do well to look into that there "colorama" Python module! It'll help
you cook up them fancy ANSI escape sequences to get some color goin'
on in your Windows command prompt (or maybe even cross-platform).
Now, I can't rightly say if that's still needed these days or
if the new-fangled consoles even require it anymore. But if
you're hankerin' to add a little pizzazz to your text, that
colorama gizmo might just do the trick.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 919 |
Nodes: | 10 (1 / 9) |
Uptime: | 69:43:36 |
Calls: | 12,185 |
Files: | 186,526 |
Messages: | 2,236,675 |