read/ edit line from stdin

Clemens Hepper ethrandil at gmx.net
Fri Mar 10 21:53:55 CET 2006


It's a bit more complicated.
The field has a default and a preassigned Value.

The default is p.e. 'localhost' and the value is 'www.gentoo.org'.
Then localhost is chosen if the value is erased to ''. But i want to
make it easy to keep the preassigned value!
So if nothing is typed 'www.gentoo.org' should be used.

I just thought that extending the commandline input interface would
be quite useful.
I want a text field that can be edited like common GUI-TextFields on
command line...

mfg
- eth

James Stroud wrote:
> 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.
> 



More information about the Python-list mailing list