【发布时间】:2018-04-25 02:33:11
【问题描述】:
我习惯以这种特殊方式写出CSV,但我
我不知道如何包含标题,因为大多数示例都不是这种格式。
ff = open('data.csv','w')
# Included here would be a typical for loop creating the below variables, i, list_name[i], list_date[i]
ff.write( "%7d, %s, %s\n" % (i, list_name[i], list_date[i]))
【问题讨论】:
-
嗨,欢迎来到 Stackoverflow,您可以使用
code formatting来实际突出显示您的代码。您可以使用4 spaces缩进您的代码行,以便它正确呈现并且其他用户知道您的代码到底在哪里。
标签: python-3.x