I am reading csv file through upload and trying to store all values in a list
def upload(request):
paramFile = request.FILES['file'].read()
data = csv.DictReader(paramFile)
list1 = []
for row in data:
list1.append(row)
print list1
file.csv
12345,abcdef
output
[{'1': '', None: ['']}, {'1': '2'}]
I want to append all values in list1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…