Do you sometimes feel really ashamed? (or: autocomplete in Python interpreter)

Do you sometimes feel like you missed something completely obvious, that you should really know about, that could have helped you many times, but you just had no idea that it exists? Something, that you simply assumed “it’s not here, move along”? I felt this way today. How did it happen? Well…

I started to use Python in elementary school – it was version ~1.4 (not 100% sure now) in 1998 or something around. I got it (probably) with the Mandriva 7.0 installation CD (yes, I was using modem connection). Since that time I was struggling with the lack of autocomplete feature in the interpreter. Few years later (2005-2006 I believe?) I discovered iPython and I simply forgot about my problem – I assumed that autocomplete is a feature added by iPython and I really liked it. My life became easy.

Few weeks ago I started to use a system written in Python, that works on machines without iPython installed (and I can’t install it too) – I didn’t need it much until I had to make use of one module installed there. It was pain. A huge, tear-squeezing pain.

Today, when I was about to start crying, I used Google – I was sure that I still can’t use autocomplete in Python interpreter, so I don’t even know why I started to look for this. And then I found:

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

Oh
My
God

I still feel really ashamed.
And dumb.
And I wonder how many surprises are still waiting for me.

source: http://kogs-www.informatik.uni-hamburg.de/~meine/python_tricks

Comments are closed.