我写这样在Django:在Django中写入CSV时不要包含逗号?
writer.writerow(['VideoName ', 'Director ', 'Cameraman ', 'Editor ', 'Reporter ', 'Tag '])
它在CSV写这样的:
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename="report.csv"'
Video, Director, Cameraman
但我只是想:
Video Director Cameraman
我在Django这样做。
这样做,回应['Content-Disposition'] ='attachment; delimiter =“”; filename =“report.csv”' 但它显示逗号。 – pynovice
不,你应该在'csv.writer'构造函数中设置分隔符。 – alecxe
是的,谢谢alecxe。 – pynovice