How to capture exit value of a program.

c program and python script.