我正在try 访问Django中的model.filefield
,以便使用csv
模块在Python中解析CSV文件.它在Windows上工作,但在Mac上给了我这个:
Exception Type: Error
Exception Value: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?
代码是这样的:
myfile = customerbulk.objects.all()[0].fileup
mydata = csv.reader(myfile)
for email,mobile,name,civilid in mydata:
print email,mobile,name,civilid