6
Answers

Calling python script within C#

Ask a question
test test

test test

11y
16.6k
1
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)