Open jaredbroad opened 9 years ago
I solved my needs with the Impromptu library:
var pyEngine = Python.CreateEngine();
var module = Assembly.LoadFile(Path.GetFullPath("main.dll"));
pyEngine.Runtime.LoadAssembly(module);
var pyScope = pyEngine.Runtime.ImportModule("main");
dynamic test = pyScope.GetVariable("BasicTemplateAlgorithm");
dynamic testInstance = pyEngine.Operations.CreateInstance(test);
IAlgorithm testType = Impromptu.ActLike<IAlgorithm>(testInstance);
Glad to hear you solved it, and sorry it's been almost a decade before I noticed this!
Hello all, incredible library I think this will do exactly what we're looking for! We have an open source loader program Lean which imports IL-DLL's.
We have C# base class:
Algorithm
which we need to import into Python. I can use IronPython to compile it to DLL but the ipy.exe pyc.py compile isn't MEF import safe I believe.So, I need to import the DLL as a MEF accessible type. I mocked it up with your framework:
With the C# base class:
So far so good:: it outputs:
Now, when I try and add in the commented out System import statement it throws with this error:
What should I try next? Am I doing this the right way?