ProcessStartInfo start = new ProcessStartInfo();
start.FileName = ;
start.Arguments = ;
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
using (Process process = Process.Start(start))
{
using (StreamReader reader = process.StandardOutput)
{
string result = reader.ReadToEnd();
Console.Write(result);
}
}
I have this python code to execute python from c#. But i dont know what to put in those two variables.
EDIT
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = @"U:\Documents\entsoe-py-master\tests\test_data\python.exe";
start.Arguments = @"U:\Documents\entsoe-py-master\tests\test_data\request.py 31.12.2016 01.01.2017 datatype"; // give filename, dates from the UI to python and query datatype
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
using (Process process = Process.Start(start))
{
using (StreamReader reader = process.StandardOutput)
{
string result = reader.ReadToEnd();
Console.Write(result);
}
}
Im getting this error :
System.ComponentModel.Win32Exception: 'The system cannot find the file specified'
On this line using (Process process = Process.Start(start))