江河建设集团有限公司网站,网站域名分几种,广东省人防工程建设网站,广告联盟官网我正在制作一个迷你Python IDE来好玩。为什么不。所以我希望能够从C调用一个python脚本#xff0c;现在我只测试一个简单的场景。我知道这不是专业IDE的工作原理。在private void Run_Click(object sender, EventArgs e){run_cmd(C:/Python34/python.exe, C…我正在制作一个迷你Python IDE来好玩。为什么不。所以我希望能够从C调用一个python脚本现在我只测试一个简单的场景。我知道这不是专业IDE的工作原理。在private void Run_Click(object sender, EventArgs e){run_cmd(C:/Python34/python.exe, C:/Users/Alaseel/Desktop/test.py);}private void About_Click(object sender, EventArgs e){// Open the about documentation}private void run_cmd(string cmd, string args){ProcessStartInfo start new ProcessStartInfo();start.FileName C:/Python34/python.exe;start.Arguments string.Format({0} {1}, cmd, args);start.UseShellExecute false;start.RedirectStandardOutput true;using (Process process Process.Start(start)){using (StreamReader reader process.StandardOutput){string result reader.ReadToEnd();Console.Write(result);}}}每当我单击Windows窗体应用程序上的“运行”按钮时它都会短暂地运行python.exe然后关闭。它实际上并不运行我传入的文件。我做错什么了吗在注run_cmd方法不是我的。我以前在一个线程上查过这个问题并使用了他们的代码。但我觉得我用错了方法。在有什么想法吗谢谢您在