Sign in to follow this  
lordcorm

Python and C++

Recommended Posts

Hi, Im looking into using Python as my scripting language, for a C++ Project im doing. But i was wondering how well Python and C++ interact with each other? Is it possible to access a C++ class through python? Is it fast? and is it reliable? I tried looking up on google if a Python class could some how point to a C++ class, but could not find anything on it. Thanks for the help in Advanced, Lordcorm

Share this post


Link to post
Share on other sites
It's possible to have C++ and Python objects and classes interact. Generally you'll want to use a library like boost::python or SWIG to handle most of the heavy lifting for getting them to talk to each other. Otherwise you need to use the Python C API for most interaction. I personally prefer boost::python.

Speed is usually "fast enough" and there isn't anything inherently unreliable about it. However, you do need to pay attention to normal C++ rules about making sure your references and pointers stay valid and such like.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this