Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Nondeterminism means never having to say you are wrong.


devel / comp.lang.python / Re: How to Add ANSI Color to User Response

SubjectAuthor
o Re: How to Add ANSI Color to User ResponseGrant Edwards

1
Re: How to Add ANSI Color to User Response

<mailman.93.1712803053.3468.python-list@python.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25657&group=comp.lang.python#25657

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: How to Add ANSI Color to User Response
Date: Wed, 10 Apr 2024 22:37:31 -0400 (EDT)
Lines: 21
Message-ID: <mailman.93.1712803053.3468.python-list@python.org>
References: <E07728FE-3599-462D-B572-107C5D53C72F@yahoo.com>
<1b305568-7ba1-4329-9f39-a0d22d769272@yahoo.co.uk>
<4VFP4C59J4znTq9@mail.python.org>
X-Trace: news.uni-berlin.de t0ZlJ3pDcg/lTw01txjrNQpqEoGj41tLdwYQU/KeNIRA==
Cancel-Lock: sha1:pLIPIjGzFTXOj4/T4mrgs2bDMDo= sha256:pIBLidd7MnIN63JQVYmFHpGpNU9pMAynGns0JNkOO68=
Return-Path: <grant.b.edwards@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.015
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'url-ip:140.82/16': 0.03;
'subject:Add': 0.04; 'ansi': 0.09; 'terminal': 0.09; 'url:github':
0.14; 'url-ip:140/8': 0.15; 'from:addr:grant.b.edwards': 0.16;
'from:name:grant edwards': 0.16; 'functions,': 0.16; 'gauld':
0.16; 'jython': 0.16; 'subject:User': 0.16; 'wrote:': 0.16;
'grant': 0.17; 'to:addr:python-list': 0.20; 'code': 0.23;
'subject:How': 0.23; "i'd": 0.24; 'notes': 0.26; 'header:User-
Agent:1': 0.30; 'python-list': 0.32; 'but': 0.32; 'there': 0.33;
'same': 0.34; 'question.': 0.35; 'following': 0.35;
'from:addr:gmail.com': 0.35; 'work,': 0.36; "skip:' 10": 0.37;
'really': 0.37; 'using': 0.37; 'way': 0.38; 'use': 0.39; 'alan':
0.40; 'want': 0.40; 'color': 0.62; 'here': 0.62; 'message-
id:invalid': 0.68; 'skip:f 20': 0.75; 'choice': 0.76;
'subject:Color': 0.84; 'subject:Response': 0.91; 'that:': 0.91
User-Agent: slrn/1.0.3 (Linux)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <4VFP4C59J4znTq9@mail.python.org>
X-Mailman-Original-References: <E07728FE-3599-462D-B572-107C5D53C72F@yahoo.com>
<1b305568-7ba1-4329-9f39-a0d22d769272@yahoo.co.uk>
 by: Grant Edwards - Thu, 11 Apr 2024 02:37 UTC

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:
>> '\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.

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-terminfo

That too is C-Python oriented, and I don't really know how to do the
same things using Jython.

--
Grant

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor