I\'m looking for the opposite to this Q&A: Convert an excel or spreadsheet column letter to its number in Pythonic fashion.
or this one but in python How to conv
import gspread def letter2num(col_letter: str) -> int: row_num, col_num = gspread.utils.a1_to_rowcol(col_letter + '1') return col_num def num2letter(col_num: int) -> str: return gspread.utils.rowcol_to_a1(1, col_num)[:-1] # letter2num('D') => returns 4 # num2letter(4) => returns 'D'