Skip to content
Related Articles

Related Articles

Reloading modules in Python

View Discussion
Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 15 Jul, 2022

The reload() is a previously imported module. If you’ve altered the module source file using an outside editor and want to test the updated version without leaving the Python interpreter, this is helpful. The module object is the return value.

Reloading modules in Python2.x

reload(module)

For above 2. x and <=Python3.3

import imp
imp.reload(module)

Reloading modules for >=Python3.4 and above

import importlib
importlib.reload(module)

How do I unload a Python module?

Unloading a Python module is not possible in Python yet.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!