Re: Detecting the first time I open/append to a file

2008-09-23 Thread Scott David Daniels
Terry Reedy wrote: [EMAIL PROTECTED] wrote: ...If I can sense that the file is being created in the first iteration, I can then use an if statement to decide whether or not I need to write the header. Question: how can I tell if the file is being created or if this its the first iteration? ...

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Terry Reedy
[EMAIL PROTECTED] wrote: I have a simulation that runs many times with different parameters, and I want to aggregate the output into a single file with one rub: I want a header to be written only the first time. My program looks a bit like this: def main(): for param in range(10): s

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Bruno Desthuilliers
Sean Davis a écrit : On Sep 23, 2:02 pm, [EMAIL PROTECTED] wrote: I have a simulation that runs many times with different parameters, and I want to aggregate the output into a single file with one rub: I want a header to be written only the first time. My program looks a bit like this: def mai

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Arnaud Delobelle
On Sep 23, 7:02 pm, [EMAIL PROTECTED] wrote: > I have a simulation that runs many times with different parameters, > and I want to aggregate the output into a  single file with one rub: I > want a header to be written only the first time. My program looks a > bit like this: > > def main(): >     fo

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Sean Davis
On Sep 23, 2:02 pm, [EMAIL PROTECTED] wrote: > I have a simulation that runs many times with different parameters, > and I want to aggregate the output into a  single file with one rub: I > want a header to be written only the first time. My program looks a > bit like this: > > def main(): >     fo

Detecting the first time I open/append to a file

2008-09-23 Thread tkpmep
I have a simulation that runs many times with different parameters, and I want to aggregate the output into a single file with one rub: I want a header to be written only the first time. My program looks a bit like this: def main(): for param in range(10): simulate(param) def simulat