编程语言
首页 > 编程语言> > python中openpyxl模块操作excel

python中openpyxl模块操作excel

作者:互联网

import pandas as pd
from openpyxl.utils import get_column_letter, column_index_from_string
import openpyxl
wb = openpyxl.load_workbook('cases.xlsx')
sh = wb['Sheet1']
for i in range(2,100000):
    ce = sh.cell(row = i,column = column_index_from_string('w'))
    print(ce.value)

    sh.cell(row = i,column =column_index_from_string('f'),value =ce.value)
wb.save(r'cases.xlsx')
wb.close()

 

标签:index,openpyxl,python,excel,ce,column,import,wb
来源: https://www.cnblogs.com/wutanghua/p/16578843.html