XD blog

blog page

python, pythonnet, windows


2014-09-17 An issue or something to know with pythonnet

pythonnet is a module which can access .net assemblies (written in C# for example).

from clr import AddReference
AddReference("something.dll or .exe")

It only works if the DLL can be found in one path in sys.path and also if all dependencies are located in the same folder. If it is not the case, dependencies must be loaded first.

from clr import AddReference
import sys
sys.path.append("path to dependencies.dll")
AddReference("dependencies.dll")
sys.path.append("path to something.dll")
AddReference("something.dll or .exe")

<-- -->

Xavier Dupré