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 the
new directory.
When I did something like this in the past I put the files MyLog0.txt,
MyLog1.txt, MyLog2.txt,... in a single directory, which was simpler and more
convenient for me when I gathered the information together for analysis:

def NewProc(FileNum):
     filename = "MyLog" + repr(FileNum) + ".txt"
     proc_log = open(filename,"w")
     proc_log.write("Output here")
     proc_log.close()
     return

for i in range(0, 5):
    NewProc(i)


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to