Stack Exchange
Call Python as process in C#
I have installed olevba in Windows, as a result, I could run it in a command prompt to retrieve VBA macros from vbaProject.bin:

Now, I want to launch this in Visual Studio, so I added the following code:
public static void printMacros()
{
    Process p = new Process();
    p.StartInfo.FileName = "python.exe";
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.Arguments = "../../oletools-0.46/oletools/olevba.py ../../oletools-0.46/oletools/vbaProject.bin";
    p.Start();
    StreamReader s = p.StandardOutput;
    String output = s.ReadToEnd();
    string[] r = output.Split(new char[] { ' ' });
    Console.WriteLine(r[0]);
    p.WaitForExit();
}

However, the compilation does not show the result well:

Note that the path ../../oletools-0.46/oletools/olevba.py in the p.StartInfo.Arguments is correct, otherwise it would raise No such file or directory error; whereas changing the second argument ../../oletools-0.46/oletools/vbaProject.bin to an irrelevant file always returns the same result.
Does anyone know what's wrong here?

Did you try specifying absolute paths instead of relative paths?

I just tried, it returned the same thing...
