Deutsch English Français Italiano |
<mailman.82.1737018581.2912.python-list@python.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Roel Schroeven <roel@roelschroeven.net> Newsgroups: comp.lang.python Subject: Re: Tools to help with text mode (i.e. non-GUI) input Date: Thu, 16 Jan 2025 10:09:36 +0100 Lines: 49 Message-ID: <mailman.82.1737018581.2912.python-list@python.org> References: <1qba5l-7rcr.ln1@q957.zbmc.eu> <bee21602-c16e-47ca-90b5-7f663e2317ad@roelschroeven.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de stXFOwDkGlxkOVtawqRcTQt6GZaEmbRdTHMuticWpBtw== Cancel-Lock: sha1:XFSQGl6RFhMOheABDLOL8aNI46w= sha256:mxPn9248ypzsyq3bsRWcjQIqUR9BKMA3/42rXSgcxFM= Return-Path: <roel@roelschroeven.net> 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=roelschroeven.net header.i=@roelschroeven.net header.b=AlE4s11F; dkim-adsp=pass; dkim-atps=neutral X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'looks': 0.02; 'entering': 0.05; 'pypi': 0.05; 'else.': 0.07; 'hitting': 0.07; 'characters,': 0.09; 'debian': 0.09; 'describe': 0.09; 'page:': 0.09; 'repositories': 0.09; 'subject:GUI': 0.09; 'terminal': 0.09; 'bash': 0.16; 'black,': 0.16; 'colours': 0.16; 'displayed': 0.16; 'input,': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.163': 0.16; 'received:internal': 0.16; 'received:messagingengine.com': 0.16; 'schreef': 0.16; 'sight': 0.16; 'url:doc': 0.16; 'url:project': 0.16; 'url:pypi': 0.16; 'url:widgets': 0.16; 'python': 0.16; 'values': 0.17; "can't": 0.17; 'to:addr:python-list': 0.20; 'input': 0.21; "i've": 0.22; 'i.e.': 0.22; 'maybe': 0.22; 'command': 0.23; "i'd": 0.24; 'seems': 0.26; 'chris': 0.28; 'header:User-Agent:1': 0.30; 'packages': 0.31; 'seem': 0.31; 'default': 0.31; 'program': 0.32; "doesn't": 0.32; 'window': 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; 'this.': 0.35; 'really': 0.36; 'change': 0.36; 'presented': 0.37; 'could': 0.37; 'way': 0.38; 'url- ip:151.101.0.223/32': 0.38; 'url-ip:151.101.128.223/32': 0.38; 'url-ip:151.101.192.223/32': 0.38; 'url-ip:151.101.64.223/32': 0.38; 'list': 0.39; 'use': 0.39; "that's": 0.39; 'least': 0.39; 'text': 0.39; 'prompt': 0.39; 'happen': 0.40; 'something': 0.40; 'want': 0.40; 'tell': 0.60; 'initial': 0.61; 'above': 0.62; 'mode': 0.62; 'everything': 0.63; 'key': 0.64; 'your': 0.64; 'down': 0.64; 'accept': 0.67; 'choose': 0.68; 'offer': 0.70; 'ability': 0.71; 'addition': 0.71; 'subject:. ': 0.73; 'absolutely': 0.84; 'from.': 0.84; 'maria': 0.84; 'narrow': 0.84; 'subject:Tools': 0.84; 'subject:input': 0.84; 'subject:text': 0.84; 'thing?': 0.84; 'url:sourceforge': 0.84; 'beauty': 0.91; 'return.': 0.91; 'received:103': 0.91; 'green': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= roelschroeven.net; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1737018578; x=1737104978; bh=5/LQzzq6KsEGNVM002D+d tTtz46uwmLdbZWRxTx4jw4=; b=AlE4s11FomG2IS38hK2FwOEQ54ZqwDqde/oJF CWZWqY7UJx44ZzrCUeiGrWDyGHSRR5diEyNfCflzvEr9T6m2Xi+6Qvp6Lzf05BcZ 8kUirF9QawDczk+ZaCGhGxkXkvzXwseYnlNNO1KeSUlX8M+7nO+fjYiPmRDw08q8 /iTG6Bw3W+c/F2gRGrwk64yB8+A8iwGdn24P2gv5lNCGVU6CK5A4nJ0kHkOvJqaU KEQO7Z0/IJ4UKYOSC1UcGNTD1GAGu2M2jCbHG5msuNYVJiQ3s3a3sMta1rL9a55H kKGBKI4nN/QhAoydtGymEu4vUbZVlVbGQAKQ/Wmpev28KcNQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1737018578; x=1737104978; bh=5 /LQzzq6KsEGNVM002D+dtTtz46uwmLdbZWRxTx4jw4=; b=CJ8T0nqK6yhntLTsE HEY01hX+z3GH0VQk/HnKakCSV9+Ydhb9M4mf5vHQziPmU7KC0mmeswFLG4kcVjmO bC14K1kCjztSqZDx7jRRi/lmrhxYiN6F86xS0fLSr5HwxJ1cVbGcPdcuGOdHimaq eOTEwzx5IjbG6o/KYBHvvj4f5skv74QZ9IJXG9zbK1zc3L3op9V8SZwNY5b7vGU1 MNWl0uvAtveVbtKL+KirbGYYk9naOfrOaFO5uiZznjtq4Tu3do3RRLylpD5GilX8 qRtuwJ7sCYvEtD6u5A99PI/kSOZns6dogFGLOHgj2x7fdMLpM5bm5SUn+q/KqpiD fAbTw== X-ME-Sender: <xms:0syIZ6jy4sxg16L6nJf1imcaZxFsIizapI6vbQXcbtIEIX0VjZ7VEg> <xme:0syIZ7Bdes1pv7E9YIvx6oStqOJcks_jfuOiY9muL-NQeUP3bQPj1jZS0JclACMic rmldif1coE1> X-ME-Received: <xmr:0syIZyFc5mK-g8izGohZRTCvDh77cfTnVI--xKsm6rfb3H81q_TGE2rePaS_7ywlNQ8Id0QGKIgm6GfWR6HMuRS9cz5f2qocBAJ58AZb2slvthc> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeiudcutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffrtefo kffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfh fhjggtgfesthejredttddvjeenucfhrhhomheptfhovghlucfutghhrhhovghvvghnuceo rhhovghlsehrohgvlhhstghhrhhovghvvghnrdhnvghtqeenucggtffrrghtthgvrhhnpe ejuefhgfegtdekjeehgfffteeileegveeuleeutdeitddtjeefjefgfeekjeefvdenucff ohhmrghinhepshhouhhrtggvfhhorhhgvgdrihhopdhphihpihdrohhrghenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgvlhesrhhovghl shgthhhrohgvvhgvnhdrnhgvthdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtph houhhtpdhrtghpthhtohepphihthhhohhnqdhlihhsthesphihthhhohhnrdhorhhg X-ME-Proxy: <xmx:0syIZzRMKuTaE-lEKK7_OC4Jx3wTinC3sWq-jPIVuXlgRx_wI-faLg> <xmx:0syIZ3zurLoYzMTMVm9OygXL7S924I5Jae8kAd9cPFKqXsQSgWmgvQ> <xmx:0syIZx6PG736bVjWEFvG2HEDTYgoVfYLFxHLGioVShKgp8-FSwgVjw> <xmx:0syIZ0x1lq0YTpHwiiLRKbVNqttK_shtGjbI01hOUYryKC3Bqir_OQ> <xmx:0syIZwoqoxkuWw17x4RmiJc4QCQTOeomQJqtmN3wBklSV9BL6WJT6s8k> Feedback-ID: i8e5b41ae:Fastmail User-Agent: Mozilla Thunderbird Content-Language: nl, 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: <bee21602-c16e-47ca-90b5-7f663e2317ad@roelschroeven.net> X-Mailman-Original-References: <1qba5l-7rcr.ln1@q957.zbmc.eu> Bytes: 8934 Op 11/01/2025 om 15:28 schreef Chris Green via Python-list: > 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. Maybe pythondialog could be useful for this. I've never used it so I can't really tell if it will fit your requirements, but at least it seems worth a look. It looks like it supports text input with a default value (https://pythondialog.sourceforge.io/doc/widgets.html#single-line-input-fields). The other thing you describe is, if I understand correctly, an input with predefined values but also the ability to enter a custom value. At first sight that doesn't seem to be provided. PyPI page: https://pypi.org/project/pythondialog/ Home page: https://pythondialog.sourceforge.io/ -- "Let everything happen to you Beauty and terror Just keep going No feeling is final" -- Rainer Maria Rilke