Python and C interface function