🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

comunicating python and C/C++

Started by
4 comments, last by borisnico 21 years, 3 months ago
I''m having a lot of trouble finding a short and simple turorial or document on how to comunicate a python script with a c/c++ program. I need to call python functions whithin C and vice-versa. It would be nice too if i could use Python objects in C++ and vice-versa. I would appreciate any help (URLs, etc..)
Advertisement
http://www.boost.org/libs/python/doc/index.html
If Python has a CORBA library, you can use that. The PortableServer allows communication between different vendor implementations and languages.

TAO (www.cs.wustl.edu/~schmidt/TAO.html) is a good C++ library for CORBA.

I know Java has a CORBA library, and I've used it to link C++ with Java programs.

EDIT: Although it's not exactly "short and simple" to learn/use...

[edited by - cgoat on March 24, 2003 4:25:09 PM]
I must nominate boost.python (see link above). It''s easy, userfriendly and powerful.

-----------------------------
Gamedev for learning.
libGDN for putting it all together.
Thanks for the replies.
I downloaded boost and i''m currently reading the documentation.

Are there other options?

I was looking for a smaller library to start with. A library that will just let me call a python function whithin C.

Something like the "libtcl" but with python.
You can link with the python library which you should already have. There is an example in the documentation that comes with the distribution in the section extending and embedding. You can find it here.

This topic is closed to new replies.

Advertisement