newbie Q on sdtin word completion

Bernd Fischer "bernd.fischer\" at xignal-A%&HY%$v#&G=.de
Thu Dec 8 09:10:58 EST 2005


Thanks, exactly what I was looking for.
I should go and buy you book ;-)

Bernd

Fredrik Lundh wrote:
> "Bernd" wrote:
> 
> 
>>I'm on a Linux env and try to get
>>word completion form sdtin done,
>>like Perl's
>> $stdin = Complete( "\t: ", @choices );
>>
>>What I have so far shows me the directory listing
>>on the second hit on TAB and not the list of
>>choices on the first like I wanted to have.
> 
> 
> your completer function is called with a prefix and an index.  for each
> completion request, readline will call this function repeatedly, with in-
> creasing indices.  for each call, you should return the corresponding
> match, or None if there are no more matches.
> 
> the second example on this page might help:
> 
>     http://effbot.org/librarybook/readline.htm
> 
> </F> 
> 
> 
> 



More information about the Python-list mailing list