Hi,
I have several different python libraries that I use, and didn't want to keep them all open at the same time.
Is there a way I can check if a library is already opened?
Thanks
Herb
Printable View
Hi,
I have several different python libraries that I use, and didn't want to keep them all open at the same time.
Is there a way I can check if a library is already opened?
Thanks
Herb
Hi Herb,
The python import statement only loads a module once.
Python does not officially support unloading modules.
You can however test to see if a module is loaded using:
type(sys.modules["modulename"])
and if there are no references to it:
del sys.modules["modulename"]