Calling a python script and obtaining a return value
I would like to be able to call a python script from within a C program, and then have that python program return a single value back to the C program. One (extremely kludgy) way to do this would be to have C execute a system call to run the python script and then direct the output to a temporary file, and then after returning, have C open up that file and convert the string into a floating point value. But that approach seems to have a lot of rather undesirable characteristics.
I have googled this, and I'm afraid I'm having difficulty understanding what they're suggesting. Does anyone have any suggestions?