Whats in your $PYTHONSTARTUP$ ?

Oleg Broytmann phd at phd.fep.ru
Tue Mar 27 11:12:36 EST 2001


On Tue, 27 Mar 2001, Paul Magwene wrote:
> Other than import statements, what little programming gems do you folks have
> in your startup files?

   From http://groups.yahoo.com/group/python-list/message/128961:

import rlcompleter, readline
#readline.parse_and_bind('tab: complete')
readline.parse_and_bind("tab: menu-complete")

import os
histfile="%s/.python-history" % os.environ["HOME"]
readline.read_history_file(histfile)

def savehist():
   global histfile
   readline.write_history_file(histfile)

import atexit
atexit.register(savehist)

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list