using System;
namespace main
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
System.Diagnostics.Process pro=new System.Diagnostics.Process();
pro.StartInfo.FileName = "python.exe";
pro.StartInfo.Arguments = "C:/Users/fgfgf/source/repos/pymain/pymain.py";
pro.StartInfo.UseShellExecute = false;
pro.StartInfo.RedirectStandardInput = true;
pro.StartInfo.RedirectStandardOutput = true;
pro.StartInfo.RedirectStandardError = true;
pro.StartInfo.CreateNoWindow = true;
pro.Start();
while (true)
{
pro.StandardInput.WriteLine("Message");
pro.StandardInput.Flush();
string x = pro.StandardOutput.ReadLine();
Console.WriteLine(x);
Console.ReadKey();
}
}
}
}
|