View Single Post
Join Date: Aug 2008
Posts: 1
Reputation: slendergreen is an unknown quantity at this point 
Solved Threads: 0
slendergreen slendergreen is offline Offline
Newbie Poster

New to Python, help printing output of system calls

 
0
  #1
Aug 18th, 2008
I'm new to Python and not anywhere near a competent programmer.

Anyway, if someone could help me get over this hump, I'd appreciate it.

I need to write a Python script that calls commands from the OS that may have lengthy output. Let's say I want to see the results of an rsync between two directories. I'd like to print the output in real-time to a web page.

My web page calls the Python script. No problem.
My Python script does a system call to rsync. No problem.

Here's were I get puzzled. No output from the rsynch makes it to the screen. It runs, but I can't see that anything is happening until the rsync is finished.

What would be the correct technique for doing this kind of thing? Basically I want to call system functions and have their status output appear just as I would have seen it from the command line.

Thanks for any tips.
Reply With Quote