excel/xlrd_shortcuts.py
def _convert(self, args):
        '''convert '(1,1)' to 'B2' and 'B2' to '(1,1)' auto-recongnize'''
        if args.find(",") > -1:
            b, a = args.replace("(", "").replace(")", "").split(",")
            a = chr(int(a)+65)#chr(65) is "A" and ord("A") is 65
            b = str(int(b)+1)
            return a+b
        else:
            a = str(int(args[1:2])-1)               # D1-->(0,3)   1-->0
            b = str(ord(args[0:1].upper())-65)      # D1-->(0,3)   D-->3       ord("D") is 68
            return "("+a+","+b+")"
def _convert(self, args):
        '''convert '(1,1)' to 'B2' and 'B2' to '(1,1)' auto-recongnize'''
        if args.find(",") > -1:
            b, a = args.replace("(", "").replace(")", "").split(",")
            a = chr(int(a)+65)#chr(65) is "A" and ord("A") is 65
            b = str(int(b)+1)
            return a+b
        else:
            a = str(int(args[1:2])-1)               # D1-->(0,3)   1-->0
            b = str(ord(args[0:1].upper())-65)      # D1-->(0,3)   D-->3       ord("D") is 68
            return "("+a+","+b+")"
def _convert ( self , args ) : if args . find ( "," ) > - 1 : b , a = args . replace ( "(" , "" ) . replace ( ")" , "" ) . split ( "," ) a = chr ( int ( a ) + 65 ) #chr(65) is "A" and ord("A") is 65 b = str ( int ( b ) + 1 ) return a + b else : a = str ( int ( args [ 1 : 2 ] ) - 1 ) # D1-->(0,3)   1-->0 b = str ( ord ( args [ 0 : 1 ] . upper ( ) ) - 65 ) # D1-->(0,3)   D-->3       ord("D") is 68 return "(" + a + "," + b + ")"
convert '(1,1)' to 'B2' and 'B2' to '(1,1)' auto-recongnize
convert ( 1 1 ) to B2 and B2 to ( 1 1 ) auto - recongnize