1. Need to import from impimport reload
2. reload(a) will only reload a, while keeping the other modules imported in a unchanged
eg:
c.py
z = 3
b.py
import c
y = 2
a.py
import b
x = 1
Execute the following code on the command line
>>>import a
>>>a.x,a.b.y,a.b.c.z
(1,2,3)
At this point, modify a.py
import b
x = 111
Modify b.py
import c
y = 222
Execute the following statement on the command line
>>>from imp import reload
>>>reload(a)
>>>a.x,a.b.y,a.b.c.z
(111,2,3)
Note: Only the modification of a.py takes effect at this time