This section provides a recipe for building a Python extension on Windows.
Grab the binary installer from http://www.python.org/ and install Python. The binary installer has all of the required header files except for config.h.
Get the source distribution and extract it into a convenient location. Copy the config.h from the PC/ directory into the include/ directory created by the installer.
Create a Setup file for your extension module, as described in chapter 2.
Get David Ascher's compile.py script from http://starship.python.net/crew/da/compile/. Run the script to create Microsoft Visual C++ project files.
Open the DSW file in Visual C++ and select Build.
If your module creates a new type, you may have trouble with this line:
Change it to:
and add the following to the module initialization function:
MyObject_Type.ob_type = &PyType_Type;
Refer to section 3 of the Python FAQ (http://www.python.org/doc/FAQ.html) for details on why you must do this.