public async Task <T> ExecuteAsync(string code) { var ironPython = IronPythonHosting.CreateEngine(); var result = ironPython.Execute(code); return(await Task.FromResult(result)); }
public PythonVM(Game game = null) { Game = game; Engine = PythonHost.CreateEngine(); Scope = Engine.CreateScope(); Reloader = new ScriptReloader("*.py"); Reloader.LoadScript = Load; if (Game != null) { Reloader.PauseGame = Game.Pause; Reloader.ResumeGame = Game.Resume; Game.Content.RegisterAssetHandler <PythonScript> (typeof(PythonScriptProvider)); } currentError = string.Empty; SetupGlobals(); }
public DynPythonEngine() { _engine = Python.CreateEngine(); }