[Tutor] Unimporting modules

Guillermo Fernandez guillermo.fernandez at epfl.ch
Tue Oct 21 12:05:29 EDT 2003


Hi,

I'm trying to unimport modules.

I try into the python interactive command line
import os
del os
and it works just fine.

But when I enter it into a function, it creates me problems.

import os

def run():
     try:
         global os
         del os
     finally:
         import os

and it makes me errors...

Could someone point me where and why I'm wrong?

Thanks,

Guille




More information about the Tutor mailing list