log = open('log.txt', 'w')print >> log, 1, 2, 3print >> log, 4, 5, 6log.close( )print 7, 8, 9print open('log.txt').read( )