Deutsch English Français Italiano |
<mailman.62.1736643524.2912.python-list@python.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail From: dn <PythonList@DancesWithMice.info> Newsgroups: comp.lang.python Subject: Re: Tools to help with text mode (i.e. non-GUI) input Date: Sun, 12 Jan 2025 13:49:03 +1300 Organization: DWM Lines: 42 Message-ID: <mailman.62.1736643524.2912.python-list@python.org> References: <1qba5l-7rcr.ln1@q957.zbmc.eu> <b36486f4-0c7a-4d39-bbe8-7166c17ea84f@DancesWithMice.info> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de KFBidhXIUyPA8cSnliVg0Ad99ZG+2dsUposBdYZbxL0Q== Cancel-Lock: sha1:Ie9xSMHnjsUAGRyeZY1qKOKErKA= sha256:jsILJsE+e0VKWosokRndw0tmCzY1UKJ1Qy/B0aQblPQ= Return-Path: <PythonList@DancesWithMice.info> X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org Authentication-Results: mail.python.org; dkim=pass reason="2048-bit key; unprotected key" header.d=danceswithmice.info header.i=@danceswithmice.info header.b=U8tPKbwa; dkim-adsp=pass; dkim-atps=neutral X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'entering': 0.05; 'else.': 0.07; 'hitting': 0.07; '=dn': 0.09; 'characters,': 0.09; 'debian': 0.09; 'from:addr:danceswithmice.info': 0.09; 'from:addr:pythonlist': 0.09; 'repositories': 0.09; 'subject:GUI': 0.09; 'terminal': 0.09; 'url:master': 0.09; 'bash': 0.16; 'black,': 0.16; 'colours': 0.16; 'displayed': 0.16; 'input,': 0.16; 'message-id:@DancesWithMice.info': 0.16; 'received:cloud': 0.16; 'received:rangi.cloud': 0.16; 'wrote:': 0.16; 'python': 0.16; 'values': 0.17; 'to:addr:python-list': 0.20; 'input': 0.21; 'i.e.': 0.22; 'maybe': 0.22; 'command': 0.23; "i'd": 0.24; 'chris': 0.28; 'header:User-Agent:1': 0.30; 'packages': 0.31; 'default': 0.31; 'program': 0.32; 'python-list': 0.32; 'window': 0.32; 'header:Organization:1': 0.32; 'but': 0.32; "i'm": 0.33; 'there': 0.33; 'header:In-Reply-To:1': 0.34; 'running': 0.35; 'runs': 0.35; 'url:)': 0.35; 'this.': 0.35; 'change': 0.36; 'presented': 0.37; 'could': 0.37; 'received:192.168': 0.37; 'way': 0.38; 'list': 0.39; 'use': 0.39; "that's": 0.39; 'text': 0.39; 'prompt': 0.39; 'something': 0.40; 'want': 0.40; 'initial': 0.61; 'above': 0.62; 'mode': 0.62; 'key': 0.64; 'down': 0.64; 'url- ip:104.16/16': 0.65; 'accept': 0.67; 'choose': 0.68; 'offer': 0.70; 'ability': 0.71; 'addition': 0.71; 'subject:. ': 0.73; 'absolutely': 0.84; 'from.': 0.84; 'mouse': 0.84; 'narrow': 0.84; 'subject:Tools': 0.84; 'subject:input': 0.84; 'subject:text': 0.84; 'thing?': 0.84; 'return.': 0.91; 'green': 0.96 DKIM-Filter: OpenDKIM Filter v2.11.0 vps.rangi.cloud 7A53B43E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info; s=staff; t=1736642950; bh=HUlTntD94Wnf3nJS/gTjuR75l89Bmi547pjn9E8J4Pw=; h=Date:From:Subject:To:References:In-Reply-To:From; b=U8tPKbwavFZonGR/CvgT6/kmnsx+1xiCB8JIldZALCFJT1+Q2PDcYOEBIPfjsJFXn vh5hZdoikUTx9nbMGFWMQGzDYxEUec0rgXGYH0jSyM9S8QstONWeXnrWPuscwW5PkU 4bZPCnM++QGorz09b99z64QrhZPTwJrJC9piwjhMeo2M7oFbbC8u1hsZfVyEsSVl68 vnjXBqAjOSFpOUyN7ngld/2zcJgzITmbVlr7xtRxifCKAPVeT9Ano+vhxmcj3xUOBO XVwziIiH18sI/quNBPAbNL62omw0hRpqExbhBzR1764CyTjCgP/7ebgIG97wMC5r/d 3HENm3iGK+Urg== User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: <1qba5l-7rcr.ln1@q957.zbmc.eu> 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: <b36486f4-0c7a-4d39-bbe8-7166c17ea84f@DancesWithMice.info> X-Mailman-Original-References: <1qba5l-7rcr.ln1@q957.zbmc.eu> Bytes: 5939 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