python如何获取多个excel单元格的值
1个回答
2018-09-24 · 百度知道官方认证企业
腾讯电脑管家
腾讯电脑管家是腾讯公司推出的免费安全管理软件,能有效预防和解决计算机上常见的安全风险,并帮助用户解决各种电脑“疑难杂症”、优化系统和网络环境,是中国综合能力最强、最稳定的安全软件。
向TA提问
关注
展开全部
from openpyxl import load_workbook
wb = load_workbook(r"D:\python_workshop\python6\study\sample.xlsx")
sh = wb["Sheet"]print(sh["A3":"B10"].value)
运行结果:
Traceback (most recent call last):
File "D:/python_workshop/python6/study/demo.py", line 8, in <module> print(sh["A3":"B10"].value)AttributeError: 'tuple' object has no attribute 'value'
wb = load_workbook(r"D:\python_workshop\python6\study\sample.xlsx")
sh = wb["Sheet"]print(sh["A3":"B10"].value)
运行结果:
Traceback (most recent call last):
File "D:/python_workshop/python6/study/demo.py", line 8, in <module> print(sh["A3":"B10"].value)AttributeError: 'tuple' object has no attribute 'value'
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询