views:

126

answers:

2
+2  Q: 

Python to C code ?

Hi, I wrote a program in python (using standard python libraries) long ago. Now I need to write the same program in standard C due to the lack of python support for that device.

Please suggest me programs or conversion method to convert that python code into C code.

Thanks in advance.

+4  A: 

Shedskin could do the trick:

Shed Skin is an experimental compiler, that can translate pure, but implicitly statically typed Python programs into optimized C++. It can generate stand-alone programs or extension modules that can be imported and used in larger Python programs.

FlorianH
Shedskin is the best option, but unfortunately, not all modules in the SPL work
Rui Vieira
Does it compile to bytecode, or to C++ code?
extraneon
+1  A: 

So there is a C library for the device? You should be able to wrap the C library with a Python module.

You can also use cython to write the interface to the C code

gnibbler