Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SamplePythonCall
class Program
static void Main(string[] args)
static private void run_cmd()
string fileName = @"C:\Users\ochi\Documents\temp\";
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = "python";//またはPython.exeのフルパス
start.Arguments = fileName;
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
using (Process process =Process.Start(start))
using (StreamReader reader = process.StandardOutput)
string result = reader.ReadToEnd();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment