i want to create IDE for python that can run line by line like anaconda. so i want return the output after each python command .
Edit: the solution is:
public Process cmd = new Process();
public string output = "";
{
cmd.StartInfo.FileName = "python.exe";
cmd.StartInfo.Arguments = @"-i";//this was the problem
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.UseShellExecute = false;
cmd.OutputDataReceived += new DataReceivedEventHandler((sender2, e2) =>
{
if (!String.IsNullOrEmpty(e2.Data))
{
output += e2.Data.ToString()+"\n";
}
});
cmd.Start();
cmd.BeginOutputReadLine();
}
{
cmd.StandardInput.WriteLine(result);//the output will take some time to complete
}