473,395 Members | 1,516 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.

porting vc++ project to python?

hi,

i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.

regards,

m

ps i guess, it's an option to transform my current code into one or more
python extensions/modules, and then calling them from a python core
module?
Aug 22 '07 #1
3 1255
i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.
You have a couple of options, but it really depends on the structure
of your program.

Option 1: You could encapsulate the important portions of your code in
DLLs and access them from python using the ctypes module.

Option 1b: You could encapsulate the important portions of your code
as COM DLLs and access them from win32com.

Option 2: You could turn your code into python extensions (DLL):
http://docs.python.org/ext/

Option 3: You could rewrite portions of your code in python and access
it from VC++: same as before - http://docs.python.org/ext/

It all depends on how your project is structured, and what you
consider to be the most difficult part to convert. If your app has a
complex user interface and that is the most difficult part to convert
then option 3 is probably best. If the code is well encapsulated and
the user interface will be easy to rewrite then options 1 or 2 will
work best. It is probably best to stay away from 1b unless portions of
your stuff already exist as COM DLLs. If you do have COM DLLs however,
accessing them from Python is very easy.

Matt
Aug 22 '07 #2
marco Starglider wrote:
hi,

i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.

regards,

m

ps i guess, it's an option to transform my current code into one or more
python extensions/modules, and then calling them from a python core
module?

Clients of mine have had very good results wrapping C++ functionality
with Boost (http://www.boost.org/libs/python/doc/). It might work for
you too.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Aug 23 '07 #3
marco Starglider schrieb:
hi,

i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.

regards,

m

ps i guess, it's an option to transform my current code into one or more
python extensions/modules, and then calling them from a python core
module?
It is. I personally prefer SIP, which is a C++ wrapper generator used to
wrap the Qt toolkit. But there are other options as well, e.g. SWIG and
Boost::Python.

Diez
Aug 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Wolfgang Keller | last post by:
Hello, as a non-developer I am currently participating in an industrial "research" project to develop a so-called "web application". This application serves at the same time as middleware to...
2
by: kikotores | last post by:
I am going back home for the summer but I have this big project to submit for one of my classes. It is written in Visual C++ 7.0 . Hoever the only C++ compiler I have at home is the free Borland...
1
by: Robin Charisse | last post by:
Hi, I have a VC++6 project that uses msxml to parse XML documents. I have been asked to port this to a .NET project but from the research I've done so far it looks as though the only way to do...
0
by: Scott Chang | last post by:
Hi all, I tried to use Managed C++ coding of VC++.NET (2002)and OpenGL version 1.2 to draw a hexagon shape of benzene. My OpenGLdrawBenzene.cpp is the following: // This is the main project file...
5
by: Pardeep Singh | last post by:
Hi all, I am migrating modules from VC++6 to VC++7. All the dll and exe modules are compiled successfully, but the applications crashes at startup. Please guide me what are the proper steps to...
1
by: siva.isukapalli | last post by:
Hi, We are involved in a porting project (from VC++ 6.0 to .Net VC++ 7.1). ** NOT C# or VB..NET. We have a custom app wizard written in 6.0. This basically creates a project with a set of...
1
by: hash | last post by:
Hello! While trying to port VC6 code to VC8, I stuck at this DLL problem. While compiling my project which is DLL, I am getting this error mfcs80d.lib(dllmodul.obj) : error LNK2005:...
2
by: sandip desale | last post by:
Dear All, We have a Tcl/Tk application written using Python 2.2. Using this application we want to call some customizable Java APIs. I tried porting Tcl/Tk application to Jython but not able to do...
6
by: =?Utf-8?B?RGlwZXNoX1NoYXJtYQ==?= | last post by:
Hi all, I am porting an code written in VC++ to VC.Net to make it manage. But in Managed VC we dont use "const" keyboard at all. but my code is using it very frequently, so is their any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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.