newbie - How do I import automatically?

bobueland at yahoo.com bobueland at yahoo.com
Tue Nov 15 15:08:49 EST 2005


When I start Python Shell I can see that some names or loaded
automatically, ready for me to use

>>> dir()
['__builtins__', '__doc__', '__name__']

I have written some functions in a file called btools.py. I would like
to import them automatically when I start up Python shell. Today I must
do it by hand like this

>>> from btools import *
>>> dir()
['__builtins__', '__doc__', '__name__', 'func1', 'func2', 'func3']
>>>

Is there a way to do this automatically so that I always have 'func1',
'func2' and so on available, without me having to do it by hand?

Bob




More information about the Python-list mailing list