@@ -279,48 +279,48 @@ public void Run(string script)
279279 }
280280 }
281281
282- public void Run ( string script , bool showConsole )
283- {
284- if ( RunDone )
285- {
286- RunDone = false ;
287- }
288- File . Create ( "python3_12\\ main.py" ) . Close ( ) ;
289- File . WriteAllText ( "python3_12\\ main.py" , script ) ;
282+ // public void Run(string script, bool showConsole)
283+ // {
284+ // if (RunDone)
285+ // {
286+ // RunDone = false;
287+ // }
288+ // File.Create("python3_12\\main.py").Close();
289+ // File.WriteAllText("python3_12\\main.py", script);
290290
291- ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
292- run0 . FileName = "python3_12\\ python.exe" ;
293- run0 . Arguments = "python3_12\\ main.py" ;
294- run0 . UseShellExecute = false ;
295- if ( ! showConsole )
296- {
297- run0 . RedirectStandardOutput = true ;
298- run0 . CreateNoWindow = true ;
299- using ( Process process = Process . Start ( run0 ) )
300- {
301- using ( StreamReader reader = process . StandardOutput )
302- {
303- string result = reader . ReadToEnd ( ) ;
304- Console . WriteLine ( result ) ;
305- RunDone = true ;
306- }
307- }
308- }
309- else
310- {
311- run0 . RedirectStandardOutput = false ;
312- run0 . CreateNoWindow = false ;
313- using ( Process process = Process . Start ( run0 ) )
314- {
315- using ( StreamReader reader = process . StandardOutput )
316- {
317- string result = reader . ReadToEnd ( ) ;
318- Console . WriteLine ( result ) ;
319- RunDone = true ;
320- }
321- }
322- }
323- }
291+ // ProcessStartInfo run0 = new ProcessStartInfo();
292+ // run0.FileName = "python3_12\\python.exe";
293+ // run0.Arguments = "python3_12\\main.py";
294+ // run0.UseShellExecute = false;
295+ // if (!showConsole)
296+ // {
297+ // run0.RedirectStandardOutput = true;
298+ // run0.CreateNoWindow = true;
299+ // using (Process process = Process.Start(run0))
300+ // {
301+ // using (StreamReader reader = process.StandardOutput)
302+ // {
303+ // string result = reader.ReadToEnd();
304+ // Console.WriteLine(result);
305+ // RunDone = true;
306+ // }
307+ // }
308+ // }
309+ // else
310+ // {
311+ // run0.RedirectStandardOutput = false;
312+ // run0.CreateNoWindow = false;
313+ // using (Process process = Process.Start(run0))
314+ // {
315+ // using (StreamReader reader = process.StandardOutput)
316+ // {
317+ // string result = reader.ReadToEnd();
318+ // Console.WriteLine(result);
319+ // RunDone = true;
320+ // }
321+ // }
322+ // }
323+ // }
324324
325325 public void RunFile ( string filePath )
326326 {
@@ -345,45 +345,45 @@ public void RunFile(string filePath)
345345 }
346346 }
347347
348- public void RunFile ( string filePath , bool showConsole )
349- {
350- if ( RunDone )
351- {
352- RunDone = false ;
353- }
354- ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
355- run0 . FileName = "python3_12\\ python.exe" ;
356- run0 . Arguments = filePath ;
357- run0 . UseShellExecute = false ;
358- if ( ! showConsole )
359- {
360- run0 . RedirectStandardOutput = true ;
361- run0 . CreateNoWindow = true ;
362- using ( Process process = Process . Start ( run0 ) )
363- {
364- using ( StreamReader reader = process . StandardOutput )
365- {
366- string result = reader . ReadToEnd ( ) ;
367- Console . WriteLine ( result ) ;
368- RunDone = true ;
369- }
370- }
371- }
372- else
373- {
374- run0 . RedirectStandardOutput = false ;
375- run0 . CreateNoWindow = false ;
376- using ( Process process = Process . Start ( run0 ) )
377- {
378- using ( StreamReader reader = process . StandardOutput )
379- {
380- string result = reader . ReadToEnd ( ) ;
381- Console . WriteLine ( result ) ;
382- RunDone = true ;
383- }
384- }
385- }
386- }
348+ // public void RunFile(string filePath, bool showConsole)
349+ // {
350+ // if (RunDone)
351+ // {
352+ // RunDone = false;
353+ // }
354+ // ProcessStartInfo run0 = new ProcessStartInfo();
355+ // run0.FileName = "python3_12\\python.exe";
356+ // run0.Arguments = filePath;
357+ // run0.UseShellExecute = false;
358+ // if (!showConsole)
359+ // {
360+ // run0.RedirectStandardOutput = true;
361+ // run0.CreateNoWindow = true;
362+ // using (Process process = Process.Start(run0))
363+ // {
364+ // using (StreamReader reader = process.StandardOutput)
365+ // {
366+ // string result = reader.ReadToEnd();
367+ // Console.WriteLine(result);
368+ // RunDone = true;
369+ // }
370+ // }
371+ // }
372+ // else
373+ // {
374+ // run0.RedirectStandardOutput = false;
375+ // run0.CreateNoWindow = false;
376+ // using (Process process = Process.Start(run0))
377+ // {
378+ // using (StreamReader reader = process.StandardOutput)
379+ // {
380+ // string result = reader.ReadToEnd();
381+ // Console.WriteLine(result);
382+ // RunDone = true;
383+ // }
384+ // }
385+ // }
386+ // }
387387
388388 public string GetOutput ( string script )
389389 {
0 commit comments