Is there a way to load a module twice in the same python session? To fill this question with an example: Here is a module:
Mod.py
x = 0 >
x = 0
You could use the __import__ function.
module1 = __import__("module") module2 = __import__("module")
Edit: As it turns out, this does not import two separate versions of the module, instead module1 and module2 will point to the same object, as pointed out by Sven.
module1
module2