C#调用Python

Cursor.Current = Cursors.WaitCursor;

Process process = new Process();

//不显示 console 窗口
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;

process.StartInfo.FileName = @"C:\Python27\Python.exe";
process.StartInfo.WorkingDirectory = get_app_path();
process.StartInfo.Arguments = get_app_path() + "parser.py";
process.Start();

process.WaitForExit();
Cursor.Current = Cursors.Default;

posted on 2014-03-29 12:17  武胜-阿伟  阅读(1124)  评论(0编辑  收藏  举报