我似乎不能让我的代码工作,它一直给我相同的'参数1必须有'写'方法
import csv
tank1 = [{'tank':1, 'product':['condenstate'], 'temp':12,'ullage':21000, 'level':70000}]
tank2 = [{'tank':2, 'product':['condenstate'], 'temp':12,'ullage':21000, 'level':70000}]
key1 = tank1,tank2[0].keys()
with open('motherwell.csv','w',newline='') as output_file:
writer = csv.writer
writer = csv.writer(output_file, key1)
writer = csv.writer(key1)
不确定你想达到什么目标,但你可能只需要:
注意:对于Python3,对于Python2,您需要以二进制文件的形式打开文件(
wb
)。在相关问题 更多 >
编程相关推荐