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

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