[PyKDE] Help on wrapping a C library
Phil Thompson
phil at riverbankcomputing.co.uk
Sat May 28 16:56:18 BST 2005
On Tuesday 24 May 2005 7:47 pm, Huaicai Mo wrote:
> Hi Phil,
>
> I am sending you the files: word.h, word.c, word.sip, configure.py,
> mytest.c and clib_makefile(the make file used to create the C library and
> the test program). After creating the C library, I added the line
> /usr/local/lib
> to the /etc/ld.so.conf file, and run:
> install word*.so /usr/local/lib
> ldconfig
>
> I don't have a python script to test the extension module. I tested
> interactively. Here is the snapshot:
>
> Python 2.3.4 (#2, Aug 19 2004, 15:49:40) [GCC 3.4.1 (Mandrakelinux (Alpha
> 3.4.1-3mdk)] on linux2 Type "help", "copyright", "credits" or "license" for
> more information.
>
> >>> import word
> >>> print word.anotherReverse("sadkfj;sadf")
>
> fdas;jfkdas
>
> >>> print word.__dict__
>
> {'create_word': <built-in function create_word>, 'Word': <class
> 'word.Word'>, 'reverse': <built-in function reverse>, '__file__':
> 'word.so', 'anotherReverse': <built-in function anotherReverse>,
> '__name__': 'word', '__doc__': None}
>
> >>> w = word.create_word("How are you?")
> >>>print w
>
> <word.Word object at 0x4038fddc>
>
> >>> print word.reverse(w)
>
> Segmentation fault
The fix will be in tonight's SIP snapshot.
Thanks,
Phil
More information about the PyQt
mailing list