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()

 

posted @ 2022-08-12 10:18  爱学习的小猫咪  阅读(22)  评论(0编辑  收藏  举报