老师,麻烦看一下这个报错是怎么回事鸭
import xlsxwriter
workbook=xlsxwriter.workbook(r'C:\Users\admin\Desktop\6_6.xlsx')
work_sheet=workbook.add_worksheet('demo')
format_dict={
"bold":True,
"font_color":'#DC143c',
'font_size':20
}
text_format=workbook.add_format(format_dict)
header=['门票总额','购物费用总额','旅途费用总额','年消费总额']
data=[742.6,4399,1298]
data.append(sum(data))
print(data)
workbook.close()
Traceback (most recent call last):
File "D:/test/mooc/day2/作图.py", line 16, in <module>
workbook=xlsxwriter.workbook(r'C:\Users\admin\Desktop\6_6.xlsx')
TypeError: 'module' object is not callable
16
收起
正在回答
1回答
同学,你好!
1、报错显示类型错误:'module'对象不可调用
2、Workbook中的W应是大写的
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星