def byte2int ( s , index = 0 ) : if six . PY2 : return ord ( s [ index ] ) return s [ index ]
get the ordinal value for letters in a string python
Get the ASCII int value of a character in a string .
def byte2int(s, index=0):
    """Get the ASCII int value of a character in a string.

    :param s: a string
    :param index: the position of desired character

    :return: ASCII int value
    """
    if six.PY2:
        return ord(s[index])
    return s[index]