I'm running:
- python 3.7.9 (64-bit)
- pythonnet 2.4.0
... and I have the following problem: I have a bunch of DLL:s, all of which implement the same interface. I want to load them, run some code and then unload them. Is it possible to "reload" a DLL using pythonnet? Do I need to reload the module as well?
def iterate_dlls():
dll_paths = [
'DLLLocation1\\DLLName.dll',
'DLLLocation2\\DLLName.dll',
]
for dll_path in dll_paths:
dir_path, dll_name = os.path.split(dll_path)
sys.path.append(dir_path)
clr.AddReference("AssemblyName")
import AssemblyName
# Usage of assembly
sys.path.remove(dir_path)
#
# ? What else is needed to completely unload the DLL here?
#