Re: [Tutor] Subprocess Stdout Redirection

2010-02-07 Thread Gil Johnson
Muhammad, I am no expert, but I think you have to call proc_log.close() in your StartProc() to make sure that the file is written out to disk. If I understand what you are doing, you are trying to generate a new path for each pass through the loop, of the form 0/, 1/,... and write "MyLog.txt" to th

[Tutor] Subprocess Stdout Redirection

2010-02-06 Thread Muhammad Ammar
Hi, Hope you will be fine and good. Following is a snippet of python code i am using for a regression testing. def StartProc(dir, parm): global proc proc_log = open(dir + os.sep + "MyLog.txt","w") #new path for each file if parm: proc = subprocess.Popen(path, 0, None, s