[python-win32] Best practices for writing extensions in C

Robin Becker robin@reportlab.com
Sat, 2 Nov 2002 13:53:13 +0000


In message <3DC3C435.9000609@acm.org>, Jon Barber <jon.barber@acm.org>
writes
>Hi,
>
>I'm in the process of exposing the Win32 PC/SC subsytem to CPython via a 
>DLL the usual way, and I have a few questions regarding best practices. 
>It's been a while since I've used C (about 9 years) so please bear with me.
>
>1.  I've written it all by hand so far, but is there any benefit to 
>using SWIG ?  I've exposed all the bits I need, and I don't intend to 
>use any other scripting language to access the API.  What other reasons 
>are there for using SWIG ?
>
>2.  What conventions to people use to document the parameters that 
>python has to supply, and can I make these visible to an end user ?
>
>3.  What is the best way to package up the extension for distribution ? 
>Do people use PPM for Win32 extensions ?
>
>Thanks for your patience.
>
>Jon.
I've had success using Sam Rushing's calldll/windll as a wrapper for
most of the things I need access to. I'm slowly trying to implement an
alternative to anygui's mswgui backend. The main point is that I get a
much smaller footprint with calldll (over win32all).

All of the programming is done in python, but I need to describe the
structures that get used in a fairly non C way.

As for packaging I've used inno and distutils for distribution. 
-- 
Robin Becker