Click here to Skip to main content
15,912,493 members

Comments by aju6 (Top 1 by date)

aju6 6-Feb-18 0:48am View    
I know that IronPython works good on this but i need to use only the normal python above version3. So,do u have any solution regarding that?

public static void Main()
{
Process process = new Process();
process.StartInfo.FileName = @"C:\\Users\arun.prabhu\\Documents\\sample_script.py";
process.StartInfo.FileName = @"C:\Users\arun.prabhu\Documents\testjsonres.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.Start();


StreamReader reader = process.StandardOutput;
string output = reader.ReadToEnd();


Console.WriteLine(output);

process.WaitForExit();
process.Close();

Console.WriteLine("\n\nPress any key to exit.");
Console.ReadLine();
}

this code works fine with .exe but i need the .py code to be executed in the C# code.