extending and embedding python as outputit generates set of and py files howeveryou often don' have to worry much about this if you are using distutils and include file in the setup specificationit will run swig automatically for you when building an extension for examplethis setup py file automatically runs swig on the listed example file setup py from distutils core import setupextension setup(name="example"version=" "py_modules ['example py']ext_modules extension("_example"["example ","example "]it turns out that this example file and the setup py file are all that are needed to have working extension module in this example if you type python setup py build_ext --inplaceyou will find that you have fully working extension in your directory jython and ironpython extending and embedding is not restricted to programs if you are working with javaconsider the use of jython (the python interpreter in java with jythonyou can simply import java libraries using the import statement for examplebash- jython jython on java_ type "copyright""creditsor "licensefor more information from java lang import system system out println("hello world"hello world if you are working with the net framework on windowsconsider the use of ironpython (complete reimplementation of the python interpreter in cwith ironpythonyou can easily access all of the net libraries from python in similar manner for exampleipy ironpython (on net copyright (cmicrosoft corporation all rights reserved import system math dir(system math['abs''acos''asin''atan''atan ''bigmul''ceiling''cos''cosh'system math cos( - covering jython and ironpython in more detail is beyond the scope of this book howeverjust keep in mind that they're both python--the most major differences are in their libraries lib fl ff