Possible Duplicate:
read subprocess stdout line by line
I'm creating my own Dropbox like serivice with small indicator applet for easy usage. I'm using rsync at first startup of the application and I want the indicator applet to have an item with whats going on about it.
So what I want, and need help with, is: how do I start a subprocess that dies when the application dies? How do I capture the ongoing output of the running subprocess?
My code is here.
I've tried this but it seems like they wont run:
rsyncRun = subprocess.Popen(["rsync","--stats","--progress","-azvv","-e","ssh", "LOCALDIR","REMOTEDIR", "--log-file=/home/daniel/.bareshare/bilderrsync.log"], shell=True, stdout=subprocess.PIPE)
lsyncdRun = subprocess.Popen(["lsyncd",lsyncdconfig], shell=True, stdout=subprocess.PIPE)