[输入]
listBox = ['status: 123', 'company: test']
[期望输出]
'zzzz' - column A already exists
'status: 123' - should be written in column B in a single cell.
'company: test' - should be written in column C in a single cell.
我试过:
def writeToCSV():
checkpointList = ['CompanyID: test', 'StatusCode: 123']
data = [str(checkpointList).split(",")]
path = "output.csv"
with open(path, "wb") as csv_file:
writer = csv.writer(csv_file, delimiter=',')
for line in data:
writer.writerow(line)
writeToCSV()
在下面尝试-
writerow
需要单个list
。你知道吗上面写着-
相关问题 更多 >
编程相关推荐