using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using IronPython.Hosting;
using IronPython.Runtime;
namespace TabbedImages {
class TabbedImages {
[STAThread]
static void Main(string[] rawArgs) {
List args = new List(rawArgs);
args.Insert(0, Application.ExecutablePath);
string dir = Path.GetDirectoryName(Application.ExecutablePath);
PythonEngine engine = new PythonEngine();
engine.AddToPath(dir);
engine.Sys.argv = List.Make(args);
Dictionary<string, object> d = new Dictionary<string, object>();
EngineModule engineModule = engine.CreateModule("__main__", d, true);
engine.DefaultModule = engineModule;
string path = Path.Combine(dir, "main.py");
engine.ExecuteFile(path);
}
}
}
Leave a comment