执行以下代码后
_engine = Python.CreateEngine();
var searchPaths = _engine.GetSearchPaths();
searchPaths.Add(@"C:\Program Files (x86)\IronPython 2.7\Lib");
_engine.SetSearchPaths(searchPaths);
_scope = _engine.CreateScope();
var pythonResult = _engine.Execute(
@"import sys
def testFunc():
return 3"
, _scope);
C#变量pythonResult
为null
。我希望它等于我可以调用的返回3
的东西。
我做错了什么?