Compiling python extensions on Windows

Alex Martelli aleaxit at yahoo.com
Sun May 27 16:51:28 EDT 2001


"Richard P. Muller" <rpm at wag.caltech.edu> wrote in message
news:3B115E7C.C70E4A8D at wag.caltech.edu...
    ...
> (2) If not, I have access to several other build environments
> (Codewarrior, Microsoft VisualStudios). Does anyone know which
> environment was used to build Python2.1 on windows? Are there easy to

Microsoft VC++6.0 is the compiler currently used for that.

> follow instructions anywhere for the build (I assume that "./configure"
> doesn't work on windows)?

The distutils make this VERY easy.  See my post of May 25 to this
group, titled "extending Python with C anywhere", and followups for
a couple of justified criticisms of the C example code I posted -- but
the setup.py distutils script WAS OK, and VERY simple indeed...:

::: setup.py:
import sys
from distutils.core import setup, Extension

bill_ext = Extension('bill', sources=['bill.c'])

setup (name = "bill",
       ext_modules = [ bill_ext ]
)
::: end-of-file

if your module bill lives in file bill.c.


Alex






More information about the Python-list mailing list