How2 use curses for data input

Miles Thompson milesthompson at sprint.ca
Thu Apr 20 16:51:46 EDT 2000


I 've read the curses part of the manual, and the HOWTO, but I'm not
much wiser. I need to capture some user input (name of a new directory
for archiving some web files), and I understand how to define a window,
etc. What I don't know to do is how to edit the lines, and loop from
last to first.

In FoxPro/dBase one could issue
    @ 5,10 say "Source file:"
    @ 5, 23 get csource
    @ 6,10 say "Destination:"
    @ 6,23 get cDestination
    READ CYCLE
and the user could loop around the fields until a (not displayed here)
OK button was clicked on.

Can the same thing be done with curses and Python, or do all the
movement keys, etc. have to be trapped and the correct movement of the
cursor applied?

I know this seems a bit antedeluvian in an age of GUI's, but the box is
a web server, I don't want to run X, and it's a very simple task. I
would like the user to be able to look at what's been typed in before
commiting to doing it.

Regards - Miles Thompson
milesthompson at sprint.ca




More information about the Python-list mailing list