Saturday, June 10, 2006

Automatic Python imports with autoimp

I got sick of writing "import X" in Python. So, I created the public domain 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.
(Module Website)

9 comments:

Yaroslav Bulatov said...

Cool, that looks useful

Connelly Barnes said...

See also Philip Eby's package Importing, described on Kevin Dangoor's blog post [1].

Unknown said...

autoimp on women's place

Unknown said...

and so led flashlight

hallsarah204@gmail.com said...

​Sounds great! You're indeed a great blogger! Go to dissertationwriting.services,
available at http://dissertationwriting.services/, and see how easy it is to buy a dissertation online! We truly understand your concerns and promise you to deliver your project in time!

Selfless said...

If you have children,buying Maplestory M Mesos always look at the ESRB rating before purchasing a game. Some games may look like they are aimed at children but have objectionable content that is not apparent from the box or other promotional materials. The rating is important, but only if you find out Maplestory 2 Mesos what each rating truly means.

smrtsmith said...

OSRS Gold is usually produced during the game upgrade process, but this method is really slow in the early stage. It is recommended to Buy OSRS Gold online. Many sellers on the Internet are doing this transaction, and OSRS Mobile Gold is very cheap. But security cannot be guaranteed. I have always been buying on the MMOAH website, the most important thing is that regular security is reassuring.

smrtsmith said...



Which site is the best one you have ever used for MUT 20 Coins?

To tell you the truth, since playing Madden NFL 20, I have been acquiring a series of virtual currencies such as MUT 20 Coins from GameMS. Because before that, I have already noticed other games on this website.

A great website that not only provides game item transactions to players, but also provides novice players with game experience and methods. This is not an accident, but a continuous output of content. This is what I appreciate GameMS very much.

As far as trading is concerned, it is well worth Buy MUT 20 Coins on GameMS. First of all, the security guarantee is absolute, mainly because the price is very good, the time-limited promotion is very real, and it is worth waiting for five to six minutes. In short, it doesn't delay players from playing games.

smrtsmith said...


How can you make a lot of POE Items on Path of Exile?

I'm playing exile version 3.9 and it's fun. If you have enough time to play seriously, then the POE Items obtained in the game can only be said to be barely enough, but I have no time to play because of work, but I really like this game and do not want to give up. So my current POE virtual items are all obtained from PoECurrency.com.

Players POE Items Buy from PoECurrency.com is very convenient and fast, the platform is very professional, and it can definitely guarantee the safety of users. The most important thing is that their service is in place, the price is very cheap, and the delivery is fast. This is a very professional third-party poe trading service platform, maybe you will also use it.