I have an external C# program which executes a Python script using the Process class.
My script returns a numerical code and I want to retrieve it from my C# program. Is this possible?
The problem is, I'm getting the return code of python.exe instead of the code returned from my script. (For example, 3.)
The interpreter does not return the value at the top of Python's stack, unless you do this:
if __name__ == "__main__":
sys.exit(main())
or if you make a call to sys.exit elsewhere.
Here's a lot more documentation on this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With