Sign in to follow this  

Python in C++

This topic is 3628 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my current project I was thinking of rendering some "cool effect" in the background of my interface while the app is running, and then I reached the conclusion that I should make some kind of scripting language to make that possible. First I was thinking of making my own, with very limited functions, but it seemed better to use some existing scripting language, and since I've used python before it seemed best to use that. So I was wondering on how I can use python to render opengl when using c++ for everything else? Can I use boost.python for this? Cause from what little I read about it, it was more "use c++ functions from python" than the other way around (which I think is what I want). I dunno... anyhow, any ideas? :)

Share this post


Link to post
Share on other sites
Quote:
Original post by S-Rave
Can I use boost.python for this? Cause from what little I read about it, it was more "use c++ functions from python" than the other way around (which I think is what I want).



Calling c++ from python is called 'extending' python, while calling python from c++ (which is much nicer I thinK!) is called 'embedding'.

There is a small chpater on it in the boost.python tutorial, but a google search on EMBEDDING PYTHON C++ would help more.

Also consider signing up to the c++-sig mailing list where lots of nice patient people have helped me in the path. It specifically concerns interfacing python and c++

hth


EDIT

sicrane has done a handy article too

Share this post


Link to post
Share on other sites
Quote:
Original post by sipickles
Calling c++ from python is called 'extending' python, while calling python from c++ (which is much nicer I thinK!) is called 'embedding'.

Here is a quite one-sided but hopefully interesting article that tries to explain why extending python can be a great option:
Extending vs. embedding Python - a heavily biased rant

Share this post


Link to post
Share on other sites

This topic is 3628 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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