def prsint ( string ) : string = stypes . stringToCharP ( string ) intval = ctypes . c_int ( ) libspice . prsint_c ( string , ctypes . byref ( intval ) ) return intval . value
python c api parse string to number
Parse a string as an integer encapsulating error handling .
def prsint(string):
    """
    Parse a string as an integer, encapsulating error handling.

    http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/prsint_c.html

    :param string: String representing an integer.
    :type string: str
    :return: Integer value obtained by parsing string.
    :rtype: int
    """
    string = stypes.stringToCharP(string)
    intval = ctypes.c_int()
    libspice.prsint_c(string, ctypes.byref(intval))
    return intval.value