I am having trouble reading in files through Python 2.7. I prompt the user to load a file, and once the filename is given, the program will simply load and print the lines in the file.
filename = raw_input("Filename to load: ")
print load_records(students, filename)
def load_records(students, filename):
#loads student records from a file
records = []
in_file = open(filename, "r")
for line in in_file:
print line
However, even if the entire file path is specified, the program throws a 'ValueError: mixing iterations and read methods would lose data.'