file.readlines() - gives me error (bad file descriptor)

Gurpreet Sachdeva gurpreet.sachdeva at gmail.com
Thu Jan 6 02:00:03 EST 2005


logfile=file(r'test.txt','a+')
logfile.write('datetime')
logfile.flush()
test=logfile.readlines()
print test

I added logfile.flush(), the 'datetime' was written in the file
correctly but I couldn't get any result...

Crazy!
Garry



More information about the Python-list mailing list