c#語言調用python編寫的應用程序
windows
windows平臺下,python打包後的應用程序爲.exe程序
using (Process myProcess = new Process())
{
myProcess.StartInfo.UseShellExecute = false;
var guid = System.Guid.NewGuid().ToString();
var jsonfile = guid + ".json";
string jsonPath = ProjectPath + @"python\dist\json\" + jsonfile;
File.WriteAllText(jsonPath, jsonData);
myProcess.StartInfo.FileName = ProjectPath + @"python\dist\python\python.exe";
myProcess.StartInfo.Arguments = jsonfile + " " + resultTemlate + " "+flag + " "+Name;
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.ErrorDialog = false;
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProce