module imports and memory usage

Brad Tilley bradtilley at
Tue Nov 30 16:02:27 CET 2004

When memory usage is a concern, is it better to do:

from X import Y


import X

Also, is there a way to load and unload modules as they are needed. I 
have some scripts that sleep for extended periods during a while loop 
and I need to be as memory friendly as possible. I can post a detailed 
script that currently uses ~ 10MB of memory if anyone is interested.


More information about the Python-list mailing list