标签:open() charm com 格式 xlsx sheet 复制 from pycharm
1)用管理员身份打开dos命令行----pip install openpyxl
2)用管理员身份运行 pycharm
复制代码
from openpyxl import load_workbook
wb=load_workbook("D:\test.xlsx") #和file=open()差不多
sheet = wb[‘test_sheet1‘] #test_sheet1是sheet表的名字
res1 = sheet.cell(row=1, column=1).value
print(res1)
‘‘‘
print(sheet.max_column)
print(sheet.max_row)‘‘‘
res2 = sheet.cell(row=2, column=2).value
print(res2)
‘‘‘print(sheet.max_column)
print(sheet.max_row)‘‘‘
res3 = sheet.cell(row=3, column=3).value
print(res3)
‘‘‘print(sheet.max_column)
print(sheet.max_row)‘‘‘
复制代码
参考文档:https://www.cnblogs.com/wuzm/p/11977694.html 感谢博主
标签:open() charm com 格式 xlsx sheet 复制 from pycharm
原文地址:https://www.cnblogs.com/6413dls/p/13957573.html