鱼c123456
发表于 2021-8-9 12:35:45
import openpyxl
#打开工作表
wb = openpyxl.load_workbook(r"D:/file/openpyxl/豆瓣电影Top250.xlsx")
ws = wb["sheet"]
for each_row in ws.iter_rows(min_row=2, max_col=1, max_row=251):
if each_row.value == "阿甘正传":
ws["B" + str(each_row.row)] = 9.8
elif each_row.value == "这个杀手不太冷":
ws["B" + str(each_row.row)] = 9.6
elif each_row.value == "肖申克的救赎":
ws["B" + str(each_row.row)] = 9.7
wb.save(r"D:/file/openpyxl/豆瓣电影Top250.xlsx")
Loregard
发表于 2021-8-14 14:45:29
111
臣卜臣卜木曹
发表于 2021-8-15 19:59:27
import openpyxl
wb = openpyxl.load_workbook(r'C:\Users\赵昌福\Desktop\豆瓣TOP250电影.xlsx')
ws = wb['Sheet']
for each_row in ws.rows:
if each_row.value == '阿甘正传':
each_row.value = '9.8'
elif each_row.value == '这个杀手不太冷':
each_row.value = '9.6'
else each_row.value == '肖申克的救赎':
each_row.value = '9.7'
一只魈咸鱼
发表于 2021-8-16 15:04:12
的
duyin456
发表于 2021-8-17 11:11:41
yyds
yuzhangdean
发表于 2021-8-17 14:52:55
bzd
Dxue
发表于 2021-8-20 11:29:48
看看
rubers
发表于 2021-8-20 13:58:38
先定位再替换?
liuywv
发表于 2021-8-30 19:47:09
学习学习
wwwccc
发表于 2021-9-1 09:05:58
拿来吧你{:10_299:}
潜水江湖
发表于 2021-9-1 10:01:34
1
沙琪玛846
发表于 2021-9-2 00:16:51
谢谢老师,正好需要用到
yi840315598
发表于 2021-9-5 16:20:18
支持小甲鱼
Mugi
发表于 2021-9-6 22:25:26
想看
a48948008
发表于 2021-9-9 13:25:57
123
ruizilake
发表于 2021-9-11 22:13:15
{:5_102:}
wangishero
发表于 2021-9-14 21:55:55
QASQL
天地
发表于 2021-9-19 00:45:48
朕想看看
starr111
发表于 2021-9-19 19:53:48
up
yaxinzhang
发表于 2021-9-23 22:13:50
朕想知道