file = open('test.txt', 'r')print file.read()while 1: char = file.read(1) # read by character if not char: break print char,file.close()