简体   繁体   English

行列转字母和数字 excel

[英]Row and column to letter and number excel

I am trying to make a program and I need to be able to transform row and column numbers to Letter of column and number of row in excel.我正在尝试制作一个程序,我需要能够将行号和列号转换为 excel 中的列字母和行数。

For example: input: (0,1) output: A1 .例如:输入: (0,1) output: A1 Can you help me?你能帮助我吗?

Here is how you can use chr() :以下是如何使用chr()

def convert(tup):
    return f'{chr(tup[0]+65)}{tup[1]}'

print(convert((0, 1)))

Output: Output:

A1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM