def save_data():
wb = openpyxl.Workbook()
print(entryArray)
for b in range(len(entryArray)):
temp = entryArray[b]
wb.cell(row=b+1, column=1).value = temp
wb.save('/home/'+getpass.getuser()+'/Desktop/FileName.xlsx')
我收到错误消息
File "C:/Users/thoma/ownCloud/Computer Science/Project/Psudo code/1.2/Project 404.py", line 292, in <module>
save_data()
File "C:/Users/thoma/ownCloud/Computer Science/Project/Psudo code/1.2/Project 404.py", line 258, in save_data
wb.cell(row=b+1, column=1).value = temp
AttributeError: 'Workbook' object has no attribute 'cell'
这是entryArray的值: ['58578','876','66','98','807','78907','90','078907','8967','760','658','467',' 58346','54','65','785','896','9-08',' - 980','456','456','09','87','89', '765','765','765','765']
如何创建XLSX表,然后使用openpyxl将这些值写入其中。 XLSX表不存在我需要在运行的函数期间创建它。
提前致谢