module imports and memory usage

Brad Tilley bradtilley at gmail.com
Tue Nov 30 10:02:27 EST 2004


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

from X import Y

or

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.

Thanks,
Brad



More information about the Python-list mailing list