I am trying to execute this following program to read csv file in sublime text2 gets error message "AttributeError: 'module' object has no attribute 'writer'" Any Solution.
import sys
import csv
def readcsv():
f = open("F://xyz.csv",'r')
readerr=csv.reader(f)
for row in readerr():
print row
f.close()
readcsv()
FULL ERROR MESSAGE
The current working directory is F:\ Traceback (most recent call last): File "F:\readfiles.py", line 12, in readcsv()
File "F:\readfiles.py", line 7, in readcsv readerr=csv.reader(f) AttributeError: 'module' object has no attribute 'reader' [Finished in 1.4s with exit code 1]
factually a valid file object?csvin yoursys.path- to know which one, just add aprint csvline just after theimport csvone.for row in readerr():shouldn't it befor row in readerr:?