Exemplo n.º 1
0
        public async Task <T> ExecuteAsync(string code)
        {
            var ironPython = IronPythonHosting.CreateEngine();
            var result     = ironPython.Execute(code);

            return(await Task.FromResult(result));
        }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public DynPythonEngine()
 {
     _engine = Python.CreateEngine();
 }