Providing 'default' value with raw_input()?

keirr keir.robinson at gmail.com
Thu Dec 22 13:49:09 EST 2005


planetthoughtful wrote:

> It seems, according to keir, that this simply can't be done via the
> command line in DOS, which is a shame.

Now, I said I couldn't think of a way to do it - not that it wasn't
possible :-)
If you don't need you program to be portable you can use extensions -
in this case
I would expect you need readline for windows, and ctypes (because
readline for windows needs ctypes).

You can fetch readline from
http://sourceforge.net/project/showfiles.php?group_id=82407
and ctypes from
http://sourceforge.net/project/showfiles.php?group_id=71702

I can't promise these will work (all my python has to be 'pure' and
cross platform so I've never used readline or rlcompleter) but
functions like insert_text look to be in the right area for what (I
think) you want. 
Good luck!

Keir.




More information about the Python-list mailing list