|
Hi Brad,
If it's for a particular page you could always just spit the results back to the web page by calling os.popen(), reading those results into a string and writing the string to the mod_python request object. If it's for some kind of background process/web service where it's not easy to write the status back, you could create a log file for writing debugging info.
If you're using Python 2.4, the subprocess module is more powerful than os.popen, so you might want to check that out. Both popen and subprocess will get it done though.
Hope this helps,
- Chris
On 8/8/06, Bradley Gabe <withanar(at)stanwinston.com> wrote:
I'm wondering if this is possible... I need to run os.system() calls through python, and I need to be able to see the line Python echos as a result.
So for example, if I want to run the command: whoami, I need to get the
string value that is echoed. The os.system() method itself just returns a number describing the status of the command.
The purpose of this is to help in debugging Apache running mod python, which is doing strange things regarding permissions.
Any help or advice appreciated!
-Brad
--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi
|