resulting dll shows up in build subdir from distutils core import setupextension setup(ext_modules=[extension('hello'['hello '])]this is python script that specifies compilation of the extension using tools in the distutils package-- standard part of python that is used to buildinstalland distribute python extensions coded in python or distutil' larger goal is automated and portable builds and installs for distributed packagesbut it also knows how to build extensions portably systems generally include setup py which installs in sitepackages of the standard library regrettablydistutils is also too large to have survived the cleaver applied to this materialsee its two manuals in python' manuals set for more details the swig integration code generator as you can probably tellmanual coding of extensions can become fairly involved (this is almost inevitable in language worki've introduced the basics in this thus far so that you understand the underlying structure but todayc extensions are usually better and more easily implemented with tool that generates all the required integration glue code automatically there are variety of such tools for use in the python worldincluding sipswigand boost pythonwe'll explore alternatives at the end of this among thesethe swig system is widely used by python developers swig--the simplified wrapper and interface generatoris an open source system created by dave beazley and now developed by its communitymuch like python it uses and +type declarations to generate complete extension modules that integrate existing libraries for use in python scripts the generated (and ++extension modules are completethey automatically handle data conversionerror protocolsreference-count managementand more that isswig is program that automatically generates all the glue code needed to plug and +components into python programssimply run swigcompile its outputand your extension work is done you still have to manage compilation and linking detailsbut the rest of the extension task is largely performed by swig simple swig example to use swiginstead of writing the code in the prior sectionwrite the function you want to use from python without any python integration logic at allas though it is to be used from alone for instanceexample - is recoding of example - as straight function the swig integration code generator