62,244
社区成员




public string test(string path)
{
string a = "";
try
{
Process p = new Process();
p.StartInfo.FileName = System.AppDomain.CurrentDomain.BaseDirectory + "/Python27/ArcGIS10.6/python.exe";
string sArguments = path; //python file
sArguments += " valid_q"; // the arguments required by the python file
p.StartInfo.Arguments = sArguments;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardError = true;
p.Start();
a =p.StandardOutput.ReadToEnd();
p.WaitForExit();
}
catch (Exception e) { return e.ToString(); }
return a;
}