473,395 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
2 4264
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Don Bruder | last post by:
A week or two ago, I asked here about porting Python to C. Got some good answers (Note 1) but now I've got another question. Actually, more a request for clarification of a topic that both the...
0
by: Jeffrey Barish | last post by:
I have been developing a Python program with two intercommunicating (using sockets) parts, one of which runs on a desktop and the other on a PDA. For ease of development, I developed them both on...
10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
3
by: pcm | last post by:
Hi, Has anyone ever worked on a Python-WinCE-based program that involved serial port management ? Regards, Philippe
4
by: H J van Rooyen | last post by:
Hi All, I am writing a polling controller for an RS-485 line that has several addressable devices connected. It is a small access control system. All is well- the code runs for anything from...
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
24
by: Joe Salmeri | last post by:
I just upgraded from Python 2.4.2 to Python 2.5.1 and have found some unexpected behavior that appears to be a bug in the os.stat module. My OS is Windows XP SP2 + all updates. I have several...
0
by: ghjk | last post by:
I want to read sms from GSM modem using C# in serial communication. I wrote the code. But i want to do it automatically. I put my code here and please tell me how can i do it automatically. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.