One problem with tab completion is that you can no longer paste tab-indented snippets into the intepreter, or use tab to indent code you're typing. I put the following in my python startup file to fix the issue:<p><pre><code> import readline, rlcompleter
readline.parse_and_bind("tab: complete")
readline.parse_and_bind('bind ^I rl_complete')
class MyCompleter(rlcompleter.Completer):
def complete(self, text, state):
if text.lstrip() == '':
if state == 0:
return text + '\t'
else:
return None
else:
return rlcompleter.Completer.complete(self, text, state)
readline.set_completer(MyCompleter().complete)</code></pre>
Wow, it's about time. It's not that hard to set up tab completion using a startup script, but that always struck me as sort of a backwards thing to have to do every time I set up a new server or workstation.
I've always wondered why so many of these usability niceties have been available yet neglected soooo long, while the language as a whole has progressed so much? There are plenty more of these, like interpreter history and adding pip to the stdlib.<p>On Windows it's even worse, newbies have to figure out how to get it in their path and hunt-down important libraries.
I don't remember the last time I used anything except iPython. I use EC2 a lot, and the first thing I do after firing an instance is install ipython, even if I don't intend to use the instance for python related stuff at all.