相关疑难解决方法(0)

使用CSV Django模块以通用换行模式打开文件

我试图访问model.filefieldDjango 中使用该模块解析Python中的CSV文件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?
Run Code Online (Sandbox Code Playgroud)

这是代码:

myfile = customerbulk.objects.all()[0].fileup

mydata = csv.reader(myfile)
    for email,mobile,name,civilid in mydata:
        print email,mobile,name,civilid
Run Code Online (Sandbox Code Playgroud)

csv django macos newline python-2.x

86
推荐指数
1
解决办法
7万
查看次数

标签 统计

csv ×1

django ×1

macos ×1

newline ×1

python-2.x ×1