Question: I've been seeing some examples of Python being used with c++, and I'm trying to understand why would someone want to do it. What are the benefits of calling C++ code from an external language such as Python?

I'd appreciate a simple example - Boost::Python will do

Answer: 
It depends on your point of view:

**Calling C++ code from a python application**

You generally want to do this when performance is an issue. Highly dynamic languages like python are typically somewhat slower then native code such as C++. "Features" of C++ such as manual memory management allows for the development of very fast libraries, which can then be called from python in order to gain performance.

Another reason is due to the fact that most libraries on both windows and \*nix are written in C or C++, and it's a huge advantage to have this existing code base available.

**Calling python code from a C++ application**

Complex applications sometimes require the ability to define additional abilities. Adding behaviors in a compiled application is messy, requires the original source code and is time consuming. Therefore it's often strategic to embed a scripting language such as python in order to make the application more flexible and customizable.

As for an example: I think you need to clarify a bit what you're interested in if you want the sample to be of any help. The boost manual provides a simple [hello world sample](http://www.boost.org/doc/libs/1_39_0/libs/python/doc/tutorial/doc/html/index.html), if that's what you're looking for.
1. Performance :

From my limited experience, Python is about 10 times slower than using C.
Using Psyco will dramatically improve it, but still about 5 times slower than C.
BUT, calling c module from python is only a little faster than Psyco.

2. When you have some libraries in C.  

For example, I am working heavily on SIP. It's a very complicated protocol stacks and there is no complete Python implementation. So my only choice is calling SIP libraries written in C.

There are also this kind of cases, like video/audio decoding.