On Thursday 27 July 2006 09:08, Andre Engels wrote: > 2006/7/27, Dave S <[EMAIL PROTECTED]>: > > It appears to be a problem with me opening the file as 'rw' although I > > have googled and opening as 'rw' appears legal. Can you only open a file > > as 'r' or 'w' - ie open & close the file twice ? > > If you use "open(filename, 'rw')", the 'w' does not have effect, and > you have opened the file read-only. To do what you want to do (both > read and write with a file), you can use "open(filename, 'r+')" > instead.
Ahh .. thanks for the heads up - I thought there had to be a better way Cheers dave _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor