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,
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
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
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