[Tutor] read, write to file

Vernon Miller vvernon@earthlink.net
Mon Jul 21 17:15:02 2003


I spend all day trying to get this to work

f=open('C:/Python22/Tools/tmp/workfile.txt', 'w')
f.write('This is the first line of the file')

after it finally seemed to work I tried to read the line with readline()

What I got was several hundred lines of x's and o's, but nothing was written
to the file

last week I went through the same thing and after rebooting several times it
finally decided to work, it seems to me that there is something
fundamentally wrong with the read, write to file functions in this latest
version of python.

Vernon Miller
vvernon@earthlink.net