Automatic Python import mechanism: autoimp initial release

Connelly Barnes connellybarnes at
Sun Jun 11 09:44:04 CEST 2006

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('.')
  >>> 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:

Comments, bugs, patches to: connellybarnes at domain


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Python-announce-list mailing list