[code.view]

[top] / python / PyMOTW / imp / imp_load_module_reload.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """
     """
     
     __version__ = "$Id$"
     #end_pymotw_header
     
     import imp
     import sys
     
     for i in range(2):
         print i,
         try:
             m = sys.modules['example']
         except KeyError:
             print '(not in sys.modules)',
         else:
             print '(have in sys.modules)',
         f, filename, description = imp.find_module('example')
         example_package = imp.load_module('example', f, filename, description)
     

[top] / python / PyMOTW / imp / imp_load_module_reload.py

contact | logmethods.com