python API wrapper for C++ API

Mark Doberenz mark.doberenz at righthemisphere.com
Tue Nov 30 09:57:41 EST 2004


Thanks Josiah and everyone else who's replied to this already.

I'm taking a look at the web site Fredrik posted and I think it's going
to help me a lot.

I think I only need to be able to call C++ from Python.  The main thing
I'm confused about is how to make it so the Python program will directly
manipulate objects in the 3D program.

My brother has used Jython and he said in there, the Python Interpreter
is an object and you can bind it to an object.  I'm not sure how this
would happen in C++ though.

Thanks,
Mark

-----Original Message-----
From: Josiah Carlson [mailto:jcarlson at uci.edu] 
Sent: Tuesday, November 30, 2004 1:59 AM
To: Mark Doberenz; python-list at python.org
Subject: Re: python API wrapper for C++ API


"Mark Doberenz" <mark.doberenz at righthemisphere.com> wrote:
> I'm fairly new at Python, but I've got a project I really want to do.
>  
> I'm working with a real-time 3D program called Deep Creator, and it 
> has a C++ API written for it.  I'm wondering what it would take to 
> create a Python wrapper that would allow me to write Python programs 
> that would call the C++ API.
>  
> The main issue I'm running into is that I need to create a DLL that I 
> load as a plugin into Deep Creator.  I then will specify a python 
> program inside Deep Creator that I want to run, and the DLL plugin 
> will be the link between the python program and Deep Creator.
>  
> I'd really appreciate any ideas or issues that people see with this 
> set up.

The first thing you need to decide is whether you want to call C++ from
Python, Python from C++, both, or whether you want to embed a Python
interpreter inside your application.

The standard places to look for this kind of thing are ctypes, SWIG, and
Boost.Python.

 - Josiah




More information about the Python-list mailing list