I've created the code to embed IronPython code in C#
public ScriptEngine GetEngine() {
if( _engine != null )
return _engine;
_engine = Python.CreateEngine();
var paths = _engine.GetSearchPaths();
paths.Add( _pythonPath );
_engine.SetSearchPaths( paths );
var runtime = _engine.Runtime;
runtime.LoadAssembly( typeof( CharacterCore ).Assembly );
return _engine;
}
public IAbility Movement() {
var engine = GetEngine();
var script = engine.CreateScriptSourceFromFile( Path.Combine( _pythonPath, "movement.py" ) );
var code = script.Compile();
var scope = engine.CreateScope();
code.Execute( scope );
return scope.GetVariable( "result" );
}
with the appropriate Python code in a separate Python project in the same solution. The code itself works, but if I set a breakpoint in Python code, it is never hit. Is there a way to have a debugger step into Python code?
I'm using Visual Studio 2015 RC (also Visual Studio 2013), Python Tools for Visual Studio (with IronPython Launcher for Python code). I've tried creating a script source from string and from file, debug never works.