openpyxl 实现excel字母列号与数字列号之间的转换


from openpyxl.utils import get_column_letter, column_index_from_string

# 根据列的数字返回字母
print(get_column_letter(2))  # B
# 根据字母返回列的数字
print(column_index_from_string('D'))  # 4

---------------------

本文来自 憶 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/weixin_43094965/article/details/82226263?utm_source=copy 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM