Reloading modules in Python

Python Methods and Functions

Note : The argument must be a module that was imported successfully.

Usage :

For Python2.x

 reload ( module ) 

For versions higher than 2.x and & lt; = Python3.3

 import imp imp.reload (  module ) 

For & gt; = Python3.4

 import importlib importlib.reload ( module ) 

For more information, check reload () .

This article courtesy of Sri Sanket Uppalapati . If you are as Python.Engineering and would like to contribute, you can also write an article using contribute.python.engineering or by posting an article contribute @ python.engineering. See my article appearing on the Python.Engineering homepage and help other geeks.

Please post comments if you find anything wrong or if you would like to share more information on the topic discussed above.





Tutorials