Autocompletion in the Python console

Hans tells us how to have autocompletion in the Python console:


import readline, rlcompleter
readline.parse_and_bind("tab: complete")

This is brilliant, but I wonder how I would ever have guessed this exact sequence of code. Isn’t it a bit obscur?

Anyhow. Hans also tells us how to have this run automatically every time the console is launched. I think it is very nice.

1 Comment

  1. Or you could just run ipython. It’s infinitely better than the standard python console

    Comment by didier — 1/6/2006 @ 14:39

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

« Blog's main page

Additional comments powered by BackType

17 queries. 0.368 seconds. Valid XHTML

Powered by WordPress

Subscribe to this blog in a reader or by Email.