By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,402 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,402 IT Pros & Developers. It's quick & easy.

How to port Python code into C++ code automatically?

P: n/a
Bo
I want to port a Python project (about 10,000 line python code) to C+
+. Is there any automatically tool to do this kind of things? e.g.,
SWIG(http://www.swig.org/)?

Any comment is welcome!

Thanks!
Mar 13 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mar 13, 3:15 am, Bo <xiebopub...@gmail.comwrote:
I want to port a Python project (about 10,000 line python code) to C+
+. Is there any automatically tool to do this kind of things? e.g.,
SWIG(http://www.swig.org/)?

Any comment is welcome!

Thanks!
There isn't a magic porting tool available.
If you said more about the why and the resources available then you
might get a better answer.

- Paddy.
Mar 13 '08 #2

P: n/a
On Wed, 12 Mar 2008 20:15:32 -0700, Bo wrote:
I want to port a Python project (about 10,000 line python code) to C+
+. Is there any automatically tool to do this kind of things? e.g.,
SWIG(http://www.swig.org/)?

Any comment is welcome!
Have a look at the ShedSkin Python-to-C++ compiler:

http://shed-skin.blogspot.com/

It has some restrictions, i.e. the code has to be written in a more or
less statically typed way.

And me too is interested in why you want to port the entire project instead
just the time critical parts? ShedSkin might help here too. As Cython_
or Pyrex_ do. Both compile a subset of Python with optional static typing
to C extension modules.

... _Cython: http://www.cython.org/
... _Pyrex: http://www.cosc.canterbury.ac.nz/gre.../python/Pyrex/

Ciao,
Marc 'BlackJack' Rintsch
Mar 13 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.