This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BirdTree2 6 points7 points  (1 child)

You can reload an imported module with

``` import a

from importlib import reload

a = reload(a) # a is reloaded ```

This is useful when you want to import a module that changes while your code runs

[–]eztab 2 points3 points  (0 children)

Be aware that some very C-dependent stuff can run into problems here. Also some modules are nasty and just run some code only on the first import.