c#调用python3程序

private void button3_Click(object sender, EventArgs e)
        {
            Process p = new Process();
            string path = @"H:\src\wel.py";
            p.StartInfo.FileName = @"E:\Python\Python36\python.exe";
            p.StartInfo.Arguments = path;
            Console.WriteLine(path);
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.CreateNoWindow = true;
       p.Start();

初接触c#,因为它方便,所以想用它做GUI,调用python程序。

百度学习了下,有个用进程启动python的方法。

但为什么我的不能用呢?

点了按钮,什么反应都没有

阅读 3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题