或许你可以考虑用ProcessStartInfo来实现。
private static void RunPythonCmd( string args)
{
ProcessStartInfo start = new ProcessStartInfo ();
start.FileName = "python";
start.Arguments = args;
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
using ( Process process = Process.Start(start))
{
using ( StreamReader reader = process.StandardOutput)
{
string result = "";
while (result != null)
{
result = reader.ReadLine();
UnityEngine. Debug.Log(result);
}
}
}
}