I looked at doing this several years ago on Windows and I seem to recall that Python had a lot of global state. So you could only have one instance of the Python VM and therefore only Python script running at once. Is this still the case?<p>In the end, for me, it was easier to share file formats between the C++ and Python and run the Python scripts out of process.
If you have the luxury of using .NET, embedding IronPython is considerably easier, in my experience. A while back I was fooling around writing a game engine with python scripting support, and it was pretty slick to get going with.
Piggy backing off this a little, in a similar vain I recently embedded Python in a macOS app (approved by the store) which was a bit of a pain to do. I documented the process as well since I couldn't find a full fledged tutorial on it.<p><a href="https://medium.com/python-pandemonium/embedding-a-python-application-in-macos-d866adfcaf94#.1396ywujo" rel="nofollow">https://medium.com/python-pandemonium/embedding-a-python-app...</a>
Something like this can be (could be?) done with a BlackBerry 10 application. I developed a hackernews client with a python backend and Qt QML frontend. Didn't involve embedding the interpreter as BB10 shipped with python3.2<p><a href="https://bitbucket.org/microcode/blackberry-py/" rel="nofollow">https://bitbucket.org/microcode/blackberry-py/</a>
<a href="http://blackberry-py.microcode.ca/" rel="nofollow">http://blackberry-py.microcode.ca/</a>
Has the embedding story improved for Python 3.* ? Whereas extending Python is easy enough, embedding has not been that convenient. Tcl, Guile, Lua do a far better job.<p>If anyone has drops of wisdom on how to run an embedded Python as a filter or an iterator I would be super interested to know.
What'r the choice points between doing this, and building a Qt app using PyQt (or PySide)? Again all the logic is in Python, no C++ whatever. And use PyInstaller or cxFreeze to make a standalone app for distribution.