[Tutor] Python to C?
Alan Gauld
alan.gauld at freenet.co.uk
Mon Jan 2 15:38:35 CET 2006
>Is there any way to convert a program in .py to .c? other then remakeing
> the program?
Thee are a couuple of projects designed to make Python run faster which
try to convert Python to something like C and compile it but its not a
general
solution and the C produced isn't in any way readable.
It would be possible to write a general convertor but its value is
debateable
since the Python style is very different to the C style. For example C is
heavily
geared to the use of pointers and pointer arithmetic, whereas Python doesn't
have any such concept and works at a higher level.
To translate Python into C would, I suspect, result in very inefficient C.
It would be much better to use Puython as executable Pseudo code
and then rewrite it in 'good' C.
Alan G
More information about the Tutor
mailing list