All pastes #794071 Raw Edit

Anonymous

public python v1 · immutable
·published 2007-11-22 21:22 UTC
rendered paste body
# CL 2007-01-23# Load this file using the PYTHONSTARTUP environment variable.# For example, you can put this in .profile:#       export PYTHONSTARTUP=$HOME/.pythonstartup.pyimport readline, rlcompleterreadline.parse_and_bind("tab: 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)