I want to call c program from python. My c program required several input arguments (for calculating several properties of image) for example, image name, central position (x_c, y_c), area, radii etc. So these input arguments I am calculating in python and then want to pass it to the c program. In python code, I need to first get image for which I need to calculate x_c, y_c, area etc. So in python script I used,
file=sys.argv[1] # here I am passing the name of input image
***
calculate x_c, y_c, area, etc...
***
Now in the same python script, I want to pass above calculated values as well as image name to the c program. In python, image name is in string and calculated values are in float, so how can I pass all to the c program using subprocess call
or os.system
?
So far I tried,
os.system("cshift "+str(file)+' '+str(x_c) +' '+str(y_c)+' '+str(area))
but its not giving me the proper answer.
Thanks in advance,
Cheers,
-Viral