Extending with C/C++

John D. Gorman jdgorman at ieee.org
Thu Nov 15 08:45:10 CET 2001

    There's a copy of compile.py in Hammond & Robinson's Python
Programming for Win32; see Chap 22.
The O'Reilley site has a zip bundle of examples at:
http://examples.oreilly.com/pythonwin32/ .
I haven't used it with Python2.1/2.2.  It'll definitely need some
You also need Mark Hammond's win32 extensions if you don't already have
(bundled w/ ActiveState's Active Python, available at the following link

    That said, you should really use distutils.  It has support for Win32
and assumes MSVC (cl.exe, etc.)
Check out the setup.py and setup_all.py scripts in the Numeric module at
It'll definitely make things easier if you ever have to distribute your
code too.

Kevin Cazabon wrote:

> I'm trying to wrap a C/C++ DLL with a Python interface to one
> function... I'm not much of a C programmer, so I was using the
> "cookbook" approach listed in the Python docs.
> However, the link to David Ascher's "compile.py" that is supposed to
> be able to generate a MSC project file is broken (so are the links on
> David's Starship Python page).
> Any suggestions?  Does that module still work with Python 2.1.1?  Are
> there easier ways to do it?
> Or better yet, has anyone already wrapped the driver interface for
> Aladdin's HASP library? (doubtful)
> Any suggestions are appreciated!
> Kevin Cazabon
> kevin at cazabon.com

More information about the Python-list mailing list