platforms are analogous but will vary as we learned in cygwin provides unix-like environment and libraries on windows to work along with the examples hereeither install cygwin on your windows platformor change the makefiles listed per your compiler and platform requirements be sure to include the path to python' install directory with - flags to access python include ( headerfilesas well as the path to the python binary library file with - flagsif neededmine point to python ' location on my laptop after building it from its source also note that you'll need tabs for the indentation in makefile rules if cut-and-paste from an ebook substituted or dropped spaces nowto use the makefile in example - to build the extension module in example - simply type standard make command at your shell (the cygwin shell is used hereand add line break for clarity)/pp /integrate/extend/hellomake - makefile hello gcc hello - - /usr/local/include/python -shared - /usr/local/bin -lpython - hello dll this generates shareable object file-- dll under cygwin on windows when compiled this waypython automatically loads and links the module when it is first imported by python script at import timethe dll binary library file will be located in directory on the python import search pathjust like py file because python always searches the current working directory on importsthis examples will run from the directory you compile them in without any file copies or moves in larger systemsyou will generally place compiled extensions in directory listed in pythonpath or pth files insteador use python' distutils to install them in the sitepackages subdirectory of the standard library finallyto call the function from python programsimply import the module hello and call its hello message function with stringyou'll get back normal python string/pp /integrate/extend/hellopython import hello hello message('world''helloworldhello message('extending''helloextendingimport module call function and that' it--you've just called an integrated module' function from python the most important thing to notice here is that the function looks exactly as if it were coded in python python callers send and receive normal string objects from the callthe python interpreter handles routing calls to the functionand the function itself handles python/ data conversion chores in factthere is little to distinguish hello as extension module at allapart from its filename python code imports the module and fetches its attributes as if it had been written in python extension modules even respond to dir calls as usual and have the simple extension module