def _try_lookup ( table , value , default = "" ) : try : string = table [ value ] except KeyError : string = default return string
returning a value from a python try function
try to get a string from the lookup table return instead of key error
def _try_lookup(table, value, default = ""):
    """ try to get a string from the lookup table, return "" instead of key
    error
    """
    try:
        string = table[ value ]
    except KeyError:
        string = default
    return string