News for hackers. Stuff that matters.
Re:Embedding the Python Interpreter in a Qt Application by FigBug on Monday March 13, 2017 @05:15PM (#13862467)
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?

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.

Re:Embedding the Python Interpreter in a Qt Application by drdaeman on Monday March 13, 2017 @08:12PM (#13863801)
Re:Embedding the Python Interpreter in a Qt Application by _wmd on Monday March 13, 2017 @11:03PM (#13864623)
Subinterpreters still share a lock and suffer from compatibility issues with C extension modules as the module interface only exports a very primitive notion of per-subinterpreter state, they're pretty much not all that safe to use unless you have a very constrained environment
Re:Embedding the Python Interpreter in a Qt Application by istotex on Monday March 13, 2017 @06:22PM (#13863058)
A big advantage of embedding the Python interpreter is that it cannot be replaced by a malicious program pretending to be Python. It’s going to be internal to your binary, so it will be difficult for someone to intercept the scripts you are executing, or modify the functionality of your application.

There are only a handful of cases where it is worthwhile to embed the Python interpreter. For most cases, running Python in a separate process is probably the best approach.