C and Python

Philippe Faes Philippe.Faes at rug.ac.be
Mon Apr 8 09:26:22 EDT 2002


I want to use python for quick prototyping and convert to C/C++ later on.
Suppose I write some modules (say 2) in python that call eachothers 
functions. Then I port one module to C/C++ and later the second module. 
In the meanwhile I will want my hybrid project (python-C) to work.

solution1: use python calls between C and python.
disadvantage: when my code is transformed to pure C, I still need python 
calls between the function (extra overhead) and I still need the python 
interpreter to make the calls. Obviously I don't want to reprogram the C 
code once it works.

solution2: same as solution1, but I could use macros for the function 
calls, so that I can just recompile a C module that calls python 
functions into a C module that call C functions. This would (in a first 
phase) be limited to primitive datatypes.

My question:
Does any of this already exist?
Any hints?

thanks.

--
Philippe Faes
Student of computer science engineering
Ghent Universitiy http://www.ftw.rug.ac.be




More information about the Python-list mailing list