ソースコード
using System.Diagnostics; using UnityEditor; using Debug = UnityEngine.Debug; public class Example { [MenuItem( "hoge/hoge" )] private static void Hoge() { var startInfo = new ProcessStartInfo { FileName = @"python", UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true, Arguments = "-V", }; using var process = Process.Start( startInfo ); var line = process!.StandardOutput.ReadLine(); process.WaitForExit(); process.Close(); Debug.Log( line ); } }