Thursday, June 1st, 2006

Autocompletion in the Python console

Filed under: — Daniel Lemire @ 12:45

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.

Leave a comment

Warning: When entering a long comment, please ensure that you make copy of your text prior to submitting it. If the server should fail or if you hit a bug, you might lose your work. I am not responsible for your lost effort.

To spammers: I carefully review every single post and make sure that spam gets deleted. You are wasting your time if you are manually entering spam using this form. Read my terms of use to see what I consider to be abusive.

Example: I + II + IX= XII. Yes, you have to enter a roman numeral. (Answer must be in upper case.)

« Blog's main page

25 queries. 0.291 seconds. Valid XHTML

Powered by WordPress

Subscribe to this blog in a reader or by Email.