Sujet : Re: Tools to help with text mode (i.e. non-GUI) input
De : grant.b.edwards (at) *nospam* gmail.com (Grant Edwards)
Groupes : comp.lang.pythonDate : 15. Jan 2025, 01:54:09
Autres entêtes
Message-ID : <mailman.79.1736902451.2912.python-list@python.org>
References : 1 2 3 4 5 6 7
User-Agent : slrn/1.0.3 (Linux)
On 2025-01-14, Chris Green via Python-list <
python-list@python.org> wrote:
Yes, thanks all, maybe just straightforward curses is the way to go.
Looking at some of the 'cleverer' ones they end up looking remarkably
like GUI code, in which case I might as well use a GUI.
The source code to configure and handle a UI with a certain set of
input widgets is going to be pretty much the same regardless of the
low-level screen bashing details involved in rendering the widgets.
You choose a TUI toolkit like curses panel/menu/forms instead of a GUI
toolkit like gtk because you need your app to run on a terminal
instead of on a X11/wayland screen, not because you want your app to
be simpler than the code for a GUI app (as you've seen, it isn't).
I have written a (fairly simple) Gtk based python program, I was
just trying to avoid all the GUI overheads for a little new project.
If you want to avoid the [TG]UI overhead, then command line options
are your friend. If that's not sophisticated enough the gnu "readline"
library with a simple command processor is a common next step.
Or you can use curses to print some help stuff at the top of the
terminal window and then do everything based on single-stroke "command
keys" that print output in the lower part of the terminal window.
-- Grant