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