This is a modified version of Jack Jensen's modulator tool. It is modified to make it feasible to regenerate the skeleton file as more objects (types really) and methods are added, without destroying previous work. It does this by using a number of include files where all your editing should go, i.e. *never* edit the generated file. The generated code includes module definition files and object definition files. They are called: _impl.i In the module definition file, you put in macro definitions for the global functions. Using EXAMPLE.py, which defines a module called 'sample', the module definition file is called 'sample_impl.i'. The module defines the functions newsimple newnumberish newott Each of these are implemented with an implementation macro called '__impl' E.g.: #define sample_newsimple_impl(args) \ ... This used to be the only way to implement functions, which can be very annoying to debug. Therefore I added a way to implement them with a separate C function. Unfortunately, the _impl.i file is included too early for implementing many functions. By defining the macro _TAIL, a second include file is included by the generated file at a more appropriate location. The tail file is called _tail.i. In there you can stick in the implementations as C functions: PyObject* __(PyObject* args) { ... } or, for objects PyObject* __(Object* self, ...) { ... } Yes, I know this is not very elegant, and maybe I should have skipped the macro stuff. If enough people complain, I might do that (as I said, the macro stuff came first and I didn't want to rewrite all the code I had). The object definition file must also define the layout of the object. This is done with the _struct macro. SUMMARY ======= In _impl.i, either write: #define __impl(args) ... #define __impl(args) ... ... or #define _TAIL 1 (or a combination. If the implementation macro is not defined, it is assumed there exist a function __) In _impl.i, always define the members: #define MyObj_struct \ int anInt; \ float aFloat; For methods, either use macros, as for global functions, or use the _TAIL trick and implement them in the _tail.i file. If this description makes no sense, don't hesitate to bug me about it. BUGS ==== I've basically just tested stuff I use myself, which does not include things like numberlike types, sequence types, struct types, etc. If you find problems with it, mail me your problems. If you fix your problems, mail me the solutions. Thanks. ----------------------------------------------------------- Daniel Larsson ABB Industrial Systems AB dlarsson@sw.seisy.abb.se