Import in a separate thread

Peter Hansen peter at engcorp.com
Sat Feb 25 07:51:48 EST 2006


cyberco wrote:
> I want to import a long list of modules in a separate thread to speed
> things up. How can I make the modules imported in that separate thread
> accessible outside the method?

Sounds like premature optimization.  Speed "things" up?  What things? 
How long is it taking now to load the modules you are loading?  Even the 
wxPython demo takes only a few seconds to load on a decent machine, and 
that's loading a *heck* of a lot of stuff.  (And it takes the 
conventional approach to this issue too, which is to display a splash 
screen while things load.)

-Peter




More information about the Python-list mailing list