Pyrex     

 
Pyrex lets you translate selected Python functions and libraries to C and compile them to native machine code. Pyrex is Python... with a couple of additional keywords like "cdef" and "int" to statically type variables.

Basically, the Pyrex development cycle is:
    - write and debug the application in Python
    - add data type keywords and convert to .c files
    - compile, install and use


Instructions for Pyrex

 

More information is available at:
      Pyrex home page: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
      Michael's Quick Guide to Pyrex: http://www.cosc.canterbury.ac.nz/%7Empj17/pyrex-guide/
 


Another alternative is Psyco.   Psyco is somewhat 'nicer' because you have less to do to get it running and there is the potential for it to be faster than typical native code (as are some Java JIT optimizations).   ...but you pay a penalty for the run-time compilation.   With Pyrex you do a one-time compile, link and install for each target platform.

With Pyrex you must also identify the data type of each variable which is often not too difficult.  Psyco doesn't care, but Psyco can get confused if a variable's data type changes mid-execution.  

Both Pyrex and Psyco seem easier to use than SWIG.

Both Pyrex and Psyco are in development so all language features may not yet be supported.