How would you get only the first line of a file as a string with Python?
To go back to the beginning of an open file and then return the first line, do this:
my_file.seek(0) first_line = my_file.readline()