Python: Having trouble reading in files -
i having trouble reading in files through python 2.7. prompt user load file, , once filename given, program load , print lines in file.
filename = raw_input("filename load: ") print load_records(students, filename) def load_records(students, filename): #loads student records file records = [] in_file = open(filename, "r") line in in_file: print line
however, if entire file path specified, program throws 'valueerror: mixing iterations , read methods lose data.'
Comments
Post a Comment