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


Groups > comp.lang.python > #197189

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

From Grant Edwards <grant.b.edwards@gmail.com>
Newsgroups comp.lang.python
Subject Re: Tools to help with text mode (i.e. non-GUI) input
Date 2025-01-14 19:54 -0500
Message-ID <mailman.79.1736902451.2912.python-list@python.org> (permalink)
References (2 earlier) <4YX8tK2xv4znb1c@mail.python.org> <0c3821d3-78c1-45c0-81da-81f9fb4c4f02@yahoo.co.uk> <mailman.70.1736844978.2912.python-list@python.org> <lhmh5l-rhnv.ln1@q957.zbmc.eu> <4YXnZ9475vznWGk@mail.python.org>

Show all headers | View raw


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

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


Thread

Re: Tools to help with text mode (i.e. non-GUI) input Alan Gauld <learn2program@gmail.com> - 2025-01-14 08:56 +0000
  Re: Tools to help with text mode (i.e. non-GUI) input Chris Green <cl@isbd.net> - 2025-01-14 09:15 +0000
    Re: Tools to help with text mode (i.e. non-GUI) input Grant Edwards <grant.b.edwards@gmail.com> - 2025-01-14 19:54 -0500
    Re: Tools to help with text mode (i.e. non-GUI) input Alan Gauld <learn2program@gmail.com> - 2025-01-16 01:06 +0000

csiph-web