Re: [Tutor] monitor subprocess and get it's output during execution

2008-09-02 Thread Kent Johnson
2008/9/1 Colin. Wang <[EMAIL PROTECTED]>: > When I try: > p = subprocess.Popen(["robocopy.exe" +" " + "DownloadArgs"],Shell = > True,stdout = PIPE) > while True: > line = p.stdout.readline() > if not line: break > time.sleep(5) ### new added > print ">", > > then robocopy download will never co

Re: [Tutor] monitor subprocess and get it's output during execution

2008-09-01 Thread Colin.Wang
2008/9/1 Kent Johnson <[EMAIL PROTECTED]> > On Sun, Aug 31, 2008 at 11:39 PM, 王珂 <[EMAIL PROTECTED]> wrote: > > > --Then I use: > > print "Download begin ..." > > p = subprocess.Popen(["robocopy.exe" +" " + "DownloadArgs"],Shell = > > True,stdout = PIPE) > > while not str(p.poll()).isdigit(): > >

Re: [Tutor] monitor subprocess and get it's output during execution

2008-09-01 Thread Kent Johnson
On Sun, Aug 31, 2008 at 11:39 PM, 王珂 <[EMAIL PROTECTED]> wrote: > --Then I use: > print "Download begin ..." > p = subprocess.Popen(["robocopy.exe" +" " + "DownloadArgs"],Shell = > True,stdout = PIPE) > while not str(p.poll()).isdigit(): > print ">", > time.sleep(10) > #don't know how

[Tutor] monitor subprocess and get it's output during execution

2008-08-31 Thread 王珂
Hi, I have a python program needs to do some download task from file server to local disk regularly. I intend to call robocopy.exe (a download tool in windows) do the real download job. --Below codes works: DownloadArgs = " \\servername\Sourcepath d:\destinationPath *.bin" os.system("robocopy.exe