Skip to content
Related Articles
Open in App
Not now

Related Articles

Reloading modules in Python

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

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
Related Articles

Start Your Coding Journey Now!