[Tutor] How to write string in a file, each one on new line???

2006-10-13 Thread Asrarahmed Kadri
Folks, I dont like to swamp your mailboxes with my trivial questions. But please tell me why this isnt working?? str = str + '\n' fd.write(str) # fd is teh file handle the traceback is as under: Traceback (most recent call last): File scrap.py, line 39, in ? fd.write(str + '\n')IOError: (0,

Re: [Tutor] How to write string in a file, each one on new line???

2006-10-13 Thread Kent Johnson
Asrarahmed Kadri wrote: Folks, I dont like to swamp your mailboxes with my trivial questions. We don't mind trivial questions, this is a list for beginners. But there is no need to swamp our mailboxes by asking the same question more than once, and if you include complete code and

Re: [Tutor] How to write this to a file?

2005-10-06 Thread Hans Dushanthakumar
PROTECTED] On Behalf Of Dick Moores Sent: Thursday, 6 October 2005 12:18 p.m. To: tutor@python.org Subject: [Tutor] How to write this to a file? I have a script that writes it's output to a file. I also print the time with print Time was %.4g seconds % (timeEnd - timeStart) How could I also have

Re: [Tutor] How to write this to a file?

2005-10-05 Thread Kent Johnson
Dick Moores wrote: I have a script that writes it's output to a file. I also print the time with print Time was %.4g seconds % (timeEnd - timeStart) How could I also have the same output of the print expression, written to the file? The formatting part of the print is just an expression