Author: Connelly Barnes
License: Public domain.
I got sick of writing import X in Python. So, I created the module autoimp,
which imports all modules automatically:
from autoimp import *
os.stat('.')
Image.open('test.bmp')
pylab.plot([1,2],[3,4])
scipy.linalg.eig([[1,2],[3,4]])
...
Thus one no longer needs to write import X. It would take too long to load
every module when one writes from autoimp import *, so the imported modules
are actually proxy objects which lazily load when they are first used. The
modules are found by searching sys.path. This module will probably save me
a lot of keystrokes; I hope you enjoy it.
Blog post, with source code link:
http://barnesc.blogspot.com/2006/06/automatic-python-imports-with-autoimp.html
Comments, bugs, patches to: connellybarnes at domain yahoo.com.
Thanks,
Connelly
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations.html