Skip to content
Advertisement

Convert Python program to C/C++ code? [closed]

is it possible to convert a Python program to C/C++?

I need to implement a couple of algorithms, and I’m not sure if the performance gap is big enough to justify all the pain I’d go through when doing it in C/C++ (which I’m not good at). I thought about writing one simple algorithm and benchmark it against such a converted solution. If that alone is significantly faster than the Python version, then I’ll have no other choice than doing it in C/C++.

Advertisement

Answer

Yes. Look at Cython. It does just that: Converts Python to C for speedups.

Advertisement