<分区>
如何从我的 C# 方法调用 Python 脚本中的函数? (没有 IronPython)
在 hello.py 中
def hello_world(msg):
print msg
在测试.cs中
ProcessStartInfo start = new ProcessStartInfo ();
start.FileName = "hello.py";
start.Arguments = string.Format("{0}", arg);
start.UseShellExecute = true;
start.RedirectStandardOutput = true;
using(Process process = Process.Start(start))
{
}