Helloworld with Python C extension

Ganesh Pal ganesh1pal at gmail.com
Tue Aug 30 02:06:59 EDT 2016


>
>
>
> Py_BuildValue with an "s" expects a C string - that is, a pointer to
> char, not just a single character. You'd need to do something like
> this:
>
> char buf[2] = {char1, 0};
> return Py_BuildValue("s", buf);
>
> ChrisA


Thanks  Chris for the clue's   it worked,  I  was just wondering  how
could the
C extension   be debugged ?

 We have pdb at python side and gdb for C  , can we run gdb on python side
?  if there is a crash like the one we saw in the above diff we are
clueless of what's happening? any idea or recommendation on how we handle
such cases

Regards,
Ganesh



More information about the Python-list mailing list