27.7.1.4. Embedding Python in another application

Here we will add some better examples and explanations for: https://docs.python.org/3/extending/embedding.html#very-high-level-embedding

"Embedding Python" basically means calling the Python interpreter from C, and possibly passing values between the two.

These examples show to to embed the Python interpreter into a C/C++ application to interface between them

One notable user of Python embedding is the gem5 simulator, see also: gem5 vs QEMU. gem5 embeds the Python interpreter in order to interpret scripts as seen from the CLI:

build/ARM/gem5.opt configs/example/fs.py

gem5 then runs that Python script, which instantiates C classes defined from Python, and then finally hands back control to the C runtime to run the actual simulation faster.