[Tutor] Console application

Ben Finney ben+python at benfinney.id.au
Sat Jan 16 19:01:47 EST 2016


Ali Moradi <adeadmarshal at gmail.com> writes:

> Hi, i don't have any clue how to write a console program that shows a
> list of options which could be chosen with keyboard and when one item
> was selected, a text shows there.

A text shows where? Shows at the point of input, at the point of the
option, at some other point?

> I want to know, which things i need to write a program like that?

I think you might want to address specific points in the grid of
characters on the terminal. That's specific to each operating system, so
you'll need an API which knows how to tell the terminal what you mean.

The Python standard library includes such an API in the ‘curses’ library
<URL:https://docs.python.org/3/library/curses.html>. Try using that and
see whether it meets your needs.

-- 
 \        “Telling pious lies to trusting children is a form of abuse, |
  `\                    plain and simple.” —Daniel Dennett, 2010-01-12 |
_o__)                                                                  |
Ben Finney



More information about the Tutor mailing list