Shuaib wrote:
Hey!
How do I call a python script from a C programme, and get results from
the python script (which is just a single integer value)?
I thought we had a FAQ about this, but I can't seem to come up with it.
At any rate, there's no standard way. If the OS supports it, you can
run the script via the standard system() call, with the command set to
redirect the output to file, then open and read the file from the C
program. How the redirection would be done is implementation-specific.
Otherwise, you're really getting off the standard trail. Things like
popen() can be helpful. You need to find a newsgroup dedicated to your
platform. For UNIX users, comp.unix.programmer is good.
Brian