Unimport module

Chmouel Boudjnah chmouel at chmouel.com
Mon Mar 14 04:36:26 CET 2005


I have some code like that to do kind of plugins load :

dir = listdir('/path/')
for i in dir:
	sys.path.append('/path/' + i "/")
	import Module
	sys.path.remove('/path/' + i "/")

it's obviously not working since it get only the first import Module 
while the others doent get replaced, the only solution for me was too :


which after it does works fine. But my question is what's happenning in 
the internals, does it free the memory of Module to do a sys.modules.pop ?

Cheers, Chmouel.

PS: Please Mail-Copy-To: i am not subscribed to the list

More information about the Python-list mailing list