I am delivering a video item to iTunes. When I run the command I get an output similar to:
$ command
[2013-01-09 11:02:14 PST] <main> DBG-X: 1%
[2013-01-09 11:02:15 PST] <main> DBG-X: 2%
[2013-01-09 11:02:16 PST] <main> DBG-X: 3%
...etc...
How would I go about updating a database field in my application to show the progress of this delivery? I imagine I would re-direct to a log file using something like stdout=subprocess.PIPE, stderr=subprocess.PIPE.
But how would I get this in real time to update the db?
I would do this (there are probably other, better ways):
nseconds and remember the last line in that file.Note that this is only almost real-time, as you only check the file every
nsecondsCode:
Hope this helps