Код: Выделить всё
import csv
import math
import os
import sys
import random
InjectionFill_1Pressure=97.90995173159602
.
.
.
CoolingTime=15.469001397937381
with open('AI_MP01.csv', 'w', newline='') as outcsvfile_withopen:
writer = csv.writer(outcsvfile_withopen)
writer.writerow(['InjectionFill_1Pressure_p6100', ... ,'CoolingTime_p6171'])
writer.writerow([InjectionFill_1Pressure, ... ,'CoolingTime'])
Вот так
[img]https:/ /i.stack.imgur.com/hAv5S.png[/img]
Я хочу использовать C# для запуска exe сейчас, но exe не выводит CSV.
Это мой код.
Код: Выделить всё
using System.Diagnostics;
private void button5_Click(object sender, EventArgs e)
{
/*example 1.
Process p = Process.Start(@"C:\Users\20111001\Desktop\AAA\ICAM_AI_20231027a\ICAM_AI\dist\ICAM_AI_final.exe");
p.WaitForExit();
*/
/*example 2.
string command = @"C:\Users\20111001\Desktop\AAA\ICAM_AI_20231027a\ICAM_AI\dist\ICAM_AI_final.exe";
ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd", "/c " + command)
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
using (Process proc = new Process())
{
proc.StartInfo = procStartInfo;
proc.Start();
return proc.StandardOutput.ReadToEnd();
}
Пример 2 имеет ошибку.
Вот так

exe также устанавливает детали.

Пожалуйста, помогите мне.
Подробнее здесь: https://stackoverflow.com/questions/783 ... rom-python
Мобильная версия