How can I extend raw_input to provide user w/ default input string?

Michael Hudson mwh at python.net
Fri Jun 8 07:40:23 EDT 2001


Skip Montanaro <skip at pobox.com> writes:

>     >> However, I was thinking about presenting the user with a default
>     >> input and give him/her the ability to edit it. Maybe I should think
>     >> about using Tkinter if this is impossible to do using a console
>     >> interface.
> 
>     Alex> You might want to check out the readline module.
> 
> I don't think that works.  I asked about it a few months ago and got a
> negatory response from Guido.  (Not that it wouldn't be useful, just that
> the readline module doesn't support it.)
> 
> There have been a couple packages announced here in the past month or so
> that are readline replacements.  One of them could probably be coerced into
> providing default values for console inputs.

Mine[1] certainly can.  But it's unixoid only at the moment, and while
porting to windows would be possible, it would be non-trivial and
hasn't been done.  I was under the impression that the OP was on
Windows.  Might have been wrong though.

Cheers,
M.


[1] Pyrepl:  http://starship.python.net/crew/mwh/hacks/pyrepl.html

-- 
  BUGS   Never use this function.  This function modifies its first
         argument.   The  identity  of  the delimiting character is
         lost.  This function cannot be used on constant strings.
                                    -- the glibc manpage for strtok(3)



More information about the Python-list mailing list