Debuggin a ptyhon extension

Thomas Heller theller at python.net
Fri May 7 15:06:05 EDT 2004


Steve Menard <devilwolf22 at hotmail.com> writes:

> thanks for your help guys. While I didnt manage to get pywin32 working
> with python_d, I wrote my own little library to do the loadLibrary,
> and that works.
>
> Thanks for the ctype hint though, I didnt know about it. Is it
> portable across platforms?

Yep.  And it's called ctypes ;-)

The windows version is stable/late-beta, non-windows is probably alpha.

<http://starship.python.net/crew/theller/ctypes>

Let me add some further comments.  IMO it pays off (if you have MSVC6)
to get your whole stuff working in debug mode.  At least pywin32 (if you
use it), python, and your own stuff.  And ctypes, of course.

And it's not that complicated anymore. Here's what I do:

- Install stock Python 2.3.3, from the python.org installer.

- Download the Python sources, or grab them with CVS (the
release-maint23 branch, if you use Python 2.3).  Make a Python Debug
build with VC 6, from the .dsw file.

- In the PCBuild directory is a brand new pydebug.iss file (you have to
get this with CVS or ViewCVS), it can be used to create a windows
installer which installs the debug binaries alongside the release
binaries.  Use Inno Setup by double clicking the iss file to create the
installer, and run it.

- Grab the pywin32 source from CVS, and build it with distutils by
entering 'python setup_win32all.py build' in the command prompt.  This
builds everything in release mode, which takes quite some time.  Build
in debug mode with 'python setup_win32all.py build -g'.  Now create a
windows installer by 'python setup_win32all.py bdist_wininst'.

The installer is created in the dist subdirectory, an exe file.  Run the
exe file to install the stuff (will install both the release and debug
build).

Thomas





More information about the Python-list mailing list