myfile = open('myfile', 'r') # open for input print myfile.readline() # read the line back print myfile.readline() # empty string: end of file myfile.close()