Python Read from Text File


Code:
# This code snippet was taken from freecodesnippets.com


myfile = open(myfile, r)             # open for input

print myfile.readline()                        # read the line back

print myfile.readline()                        # empty string: end of file

myfile.close()