test test

test test

  • NA
  • 7
  • 30.6k

Calling python script within C#

Jul 18 2013 5:08 AM
Hi Guys,

I am trying to call a python script within C#. I can call normal python scripts that do not require any arguments but my particular script requires one argument. I would greatly appreciate it if someone could help me out how to send an argument.

This is the code below:

            Process p = new Process();
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.FileName = "/usr/bin/python";
            p.StartInfo.Arguments = "/path/to/pythonscript.py ";
            p.Start();

Answers (6)