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