read/ edit line from stdin

James Stroud jstroud at ucla.edu
Fri Mar 10 15:39:09 EST 2006


Clemens Hepper wrote:
> Hello,
> for my project confux (http://confux.sourceforge.net) I want to read
> a line from stdin.
> But I don't want the user to type a new line. I want so display a
> value which the user can edit.
> 
> For example I want to ask the user for a hostname and I print
> "localhost", the user modified it to "localserver" and I read it
> after <return>.
> 
> What is the fastest way to realize that? I do NOT want to use curses
> (yet) ;-).
> 
> mfg
> - eth

Why don't you just make "localhost" the default and have the user enter 
the complete name if they want it different. Seems like this is the way 
every CL program I've ever seen works.

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list