[Tutor] Iterating writing in a file (original) (raw)
Bernard Lebel python at bernardlebel.com
Tue Jul 13 23:24:30 CEST 2004
- Previous message: [Tutor] Iterating writing in a file
- Next message: [Tutor] Use of POPEN
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
I wish to do an iteration that will write something on each new line in a text file. Something like this:
sFile = 'C:\myFile.txt' oFile = file( sFile, 'rw' )
for oLine in range(1,10): oFile.write( 'text' )
However when I run this I get an IO error for the oFile.write() line.
Any suggestion? Thanks Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tutor/attachments/20040713/c001c05b/attachment.htm
- Previous message: [Tutor] Iterating writing in a file
- Next message: [Tutor] Use of POPEN
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]