[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, 'Error')

-- To HIM you shall return. 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


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 complete error tracebacks you 
have a much better chance of getting a good answer.

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor