1
在我的Python代码中,我试图设置一个范围('E3:H28')。但是,'H'列字母需要是一个变量。下面的代码不会为我跑:在openpyxl中,如何使用'get_column_letter'函数设置范围?
mo = 3
bc_col = 5 + mo
for row in ws.iter_rows('E3:get_column_letter(bc_col)28'):
for cell in row:
ws_blnd1[cell.coordinate] = ws[cell.coordinate].value
查理C,你的“否则”解决方案为我工作。非常感谢你。哪里是最好的地方,以获得openpyxl 2.4?,丰富 –
'pip安装-U --pre openpyxl' –