Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #99429
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: readline and TAB-completion? |
| Date | 2015-11-25 10:44 +0100 |
| Organization | None |
| Message-ID | <mailman.63.1448444665.20593.python-list@python.org> (permalink) |
| References | <n33mde$bgg$1@news2.informatik.uni-stuttgart.de> |
Ulli Horlacher wrote:
> I need an input function with GNU readline support. So far I have:
>
> import readline
> readline.parse_and_bind("tab: complete")
>
> file = raw_input('File to send: ')
>
>
> Cursor keys are working, but TAB-completion works only in the current
> directory. Example:
>
>
> File to send: [TAB][TAB]
> argv.py error.py md5b64.py x.py
[...]
> Is there a way to make TAB-completion work for other directories, too?
Remove "/" from the set of delimiters:
readline.set_completer_delims(
"".join(c for c in readline.get_completer_delims() if c != "/"))
> murksigkeiten
I wonder what's in there ;)
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
readline and TAB-completion? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-11-25 07:02 +0000
Re: readline and TAB-completion? Peter Otten <__peter__@web.de> - 2015-11-25 10:44 +0100
Re: readline and TAB-completion? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-11-25 12:44 +0000
csiph-web