Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197160

Re: Tools to help with text mode (i.e. non-GUI) input

From dn <PythonList@DancesWithMice.info>
Newsgroups comp.lang.python
Subject Re: Tools to help with text mode (i.e. non-GUI) input
Date 2025-01-12 13:49 +1300
Organization DWM
Message-ID <mailman.62.1736643524.2912.python-list@python.org> (permalink)
References <1qba5l-7rcr.ln1@q957.zbmc.eu> <b36486f4-0c7a-4d39-bbe8-7166c17ea84f@DancesWithMice.info>

Show all headers | View raw


On 12/01/25 03:28, Chris Green via Python-list wrote:
> I'm looking for Python packages that can help with text mode input,
> i.e. for use with non-GUI programs that one runs from the command
> prompt in a terminal window running a bash shell or some such.
> 
> What I'm specifically after is a way to provide a default value that
> can be accepted or changed easily and also a way to provide a number
> of different values to choose from.
> 
> I.e. for the default sort of input one might see:-
> 
>      Colour? red
> 
> Hitting return would return 'red' to the program but you could also
> backspace over the 'red' and enter something else.  Maybe even better
> would be that the 'red' disappears as soon as you hit any key other
> than return.
> 
> 
> For the select a value type of input I want something like the above
> but hitting (say) arrow up and arrow down would change the value
> displayed by the 'Colour?' prompt and hitting return would accept the
> chosen value.  In addition I want the ability to narrow down the list
> by entering one or more initial characters, so if you enter 'b' at the
> Colour? prompt the list of values presented would only include colours
> starting with 'b' (beige, blue, black, etc.)
> 
> 
> Are there any packages that offer this sort of thing? I'd prefer ones
> from the Debian repositories but that's not absolutely necessary.
> 
> 
> It might also be possible/useful to use the mouse for this.

There must be more choices/combinations of packages to do this. Maybe a 
good place to start is the Python Prompt Toolkit 
(https://python-prompt-toolkit.readthedocs.io/en/master/)


-- 
Regards,
=dn

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Tools to help with text mode (i.e. non-GUI) input Chris Green <cl@isbd.net> - 2025-01-11 14:28 +0000
  Re: Tools to help with text mode (i.e. non-GUI) input dn <PythonList@DancesWithMice.info> - 2025-01-12 13:49 +1300
  Re: Tools to help with text mode (i.e. non-GUI) input rustbuckett@nope.com - 2025-01-11 21:49 -0500
    Re: Tools to help with text mode (i.e. non-GUI) input Chris Green <cl@isbd.net> - 2025-01-12 12:03 +0000
  Re: Tools to help with text mode (i.e. non-GUI) input Roel Schroeven <roel@roelschroeven.net> - 2025-01-16 10:09 +0100

csiph-web