Calling C programs

C GIllespie csgcsg39 at hotmail.com
Thu Mar 4 11:41:58 CET 2004


Dear All,

I have a simple C program which outputs a string. I want to be able to call
this progam from python and assign the output to a variable. What's the best
way to do this?

I've tried

os.system('/tmp/hello')
and
os.execv('/tmp/hello',[' '])

but I can't seem to store the return value.

Many thanks

Colin





More information about the Python-list mailing list