The code is as follows: the path is script address
Public string test (string path)
{
String a="";
Try
{
The Process of p=new Process ();
P. tartInfo. FileName=System. The AppDomain. CurrentDomain. BaseDirectory + "/Python27/ArcGIS10.6/python. Exe";
String sArguments=path;//python file
SArguments +="valid_q";//the arguments required by the python file
P. tartInfo. The Arguments=sArguments;
P. tartInfo. UseShellExecute=false;
P. tartInfo. RedirectStandardOutput=true;
P. tartInfo. RedirectStandardInput=true;
P. tartInfo. RedirectStandardError=true;
P. tart ();
A=p. tandardOutput. ReadToEnd ();
P.W aitForExit ();
}
The catch (Exception e) {return e. oString (); }
return a;
}
Error figure