/// <summary>
        /// This can throw any exceptions raised by the code. If PythonSystemExitException is thrown, the host should 
        /// interpret that in a way that is appropriate for the host.
        /// </summary>
        public void Execute(EngineModule engineModule, IDictionary<string, object> locals)
        {
            engine.EnsureValidModule(engineModule);

            ModuleScope moduleScope = engineModule.GetModuleScope(locals);
            Run(moduleScope);
        }
示例#2
0
文件: Form1.cs 项目: ralescano/castle
		public Form1()
		{
			EngineOptions options = new EngineOptions();
			eng = new PythonEngine(options);
			eng.Import("site");
			System.IO.FileStream fs = new System.IO.FileStream("scripting-log.txt", System.IO.FileMode.Create);
			eng.SetStandardOutput(fs);
			eng.SetStandardError(fs);

			mod1 = eng.CreateModule("mr", false);

			InitializeComponent();
		}
 public void Execute(EngineModule engineModule)
 {
     Execute(engineModule, null);
 }