Python question on cgi

Gerhard Häring gerhard.haering at gmx.de
Sat Sep 21 02:59:25 CEST 2002


* Ken <ken at hotmail.com> [2002-09-21 10:41 +1000]:
> Hi all, how do I pass parameters to a backend C++ program and how do I know
> when does the C++ program ends so that I can read the output file produced
> by the C++ program and print to the HTML interface?

Check out the os.popen and/or the functions in the popen2 module. The
most simplistic example would be:

output_of_other_program = os.popen("/bin/ls /").read()

waiting-to-be-bashed-for-not-closing-the-stream-ly yours,

-- Gerhard




More information about the Python-list mailing list