using System.Reflection; using IronPython.Hosting; using Microsoft.Scripting.Hosting; using SupplierManager.Extensions; namespace SupplierManager.Common { public class StaticData { public readonly static object obj = new object(); public static ScriptEngine eng = Python.CreateEngine(); public static ScriptScope scope1 = eng.CreateScope(); public static ScriptScope scope2 = eng.CreateScope(); public static ScriptScope scope3 = eng.CreateScope(); public static void GetWebAPIMethod() { eng.Runtime.LoadAssembly(Assembly.GetExecutingAssembly()); eng.ExecuteFile("script\\webapi.py", scope1); } public static void GetWebAPIMethod1() { eng.ExecuteFile("script\\a.py", scope1); } public static void GetWebAPIMethod2() { eng.ExecuteFile("script\\b.py", scope1); } } }