I'm using the the python os.system to print a value received from a C file.
My C file says...
#include <stdio.h>
main()
{
printf("hello world\n");
return 7;
}
Then I have a python file which does the following...
import os
x = os.system("./a.out")
print x
When I run the python program on a linux command line, I get "hello world" successfully printed, but the variable x is printed as 1792.
I want x to be printed as 7, not 1792. Why is x being printed as 1792 and how do I fix it?