Jul-01-2018, 07:52 AM
it's late in the evening for Larz and maybe he is tired so he suggest something that will raise exception
import csv with open('File.csv') as fp: reader = csv.reader(fp) fields = None # no need of this fields = [field for field in reader] # you will read the whole file here # process fields here next(reader) # this will rise an exception because reader is exhausted - you are at the end of the filebetter
import csv with open('File.csv') as fp: reader = csv.reader(fp) for line in reader: # iterate over lines in the file # process line here
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs