I'm testing subprocess option in Python. I wrote simple code in C and I want run it by subprocess in Python. This is how it looks :
C code example.c (first I execute code and then in subprocess I'm using executable file) :
#include <stdio.h>
int main(int argc, char *argv[]) {
int number= 2110;
while (1==1)
{
printf("%d",number);
printf(" return number: ")
return number;
}
return 0;
}
Python Code :
def subTest():
while True:
numberS = subprocess.call('./example')
print (numberS)
Output which I should have after run python code :
2110 return number: 2110
Output which I get :
2110 return number: 62
I test it on some 'numbers' and proper values I get up to 255 then 256 -> 0 etc why's that ? Why it gives 8bit values and how to do it to return proper values ?