def ascii2int(str, base=10,

              int=int):

    """ Convert a string to an integer.

        Works like int() except that in case of an error no
        exception raised but 0 is returned; this makes it useful in
        conjunction with map().

    """
    try:
        return int(str, base)
    except:
        return 0