[Tutor] Python to C++

Andreas Kostyrka andreas at kostyrka.org
Thu Mar 20 15:48:29 CET 2008


If you need to rewrite Python code for performance, I'd recommend using
Pyrex/Cython. (www.cython.org).

It let's you get away with small changes to your code as a starter
(Cython is relative compatible syntax-wise with Python), and you can add
"C type annotations" as needed. (And no, C++ is not cost effective
compared to C in this "Python speedup" scenario: you get a more complex
solution without readily available benefits.)

It's also integrated with distutils/setuptools.

Andreas


Am Mittwoch, den 19.03.2008, 16:52 -0700 schrieb Dinesh B Vadhia:
> Say because of performance, you might want to re-write/convert Python
> code to C++.  What is the best way (or best practice) to do this wrt
> the tools available?
>  
> Dinesh
>  
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.python.org/pipermail/tutor/attachments/20080320/86706298/attachment.pgp 


More information about the Tutor mailing list