Top "Python-embedding" questions

Questions regarding embedding Python interpreter in other applications, such that it may serve as a scripting language.

Calling a python method from C/C++, and extracting its return value

I'd like to call a custom function that is defined in a python module from C. I have some preliminary …

c++ python c python-c-api python-embedding
How To catch python stdout in c++ code

I have a program which during it's run sometimes needs to call python in order to preform some tasks. I …

c++ python redirect python-c-api python-embedding
Create an object using Python's C API

Say I have my object layout defined as: typedef struct { PyObject_HEAD // Other stuff... } pyfoo; ...and my type definition: static …

python c python-c-api python-extensions python-embedding
Embedding a matplotlib animation into a tkinter frame

For a project I am working on a simple harmonic motion simulator (How a mass oscillates over time). I have …

python animation matplotlib tkinter python-embedding
Interacting with MatplotlibWidget created with Qt Designer in python code

I am facing a problem interacting with the MatplotlibWidget that I creater via Qt Designer. I am unable to change …

python matplotlib pyqt python-embedding
youtube-dl only extract playlist info

ydl = youtube_dl.YoutubeDL() with ydl: r = ydl.extract_info("myplaylist", download=False) # don't download, much faster print(r['uploader'],…

python youtube-dl python-embedding
Why does PyImport_Import fail to load a module from the current directory?

I'm trying to run the embedding example and I can't load a module from the current working directory unless I …

python linux python-2.7 python-embedding
Is it possible to modify PYTHONPATH at runtime?

I have a C++ application dynamically linked to the Python interpreter. I want to be able to import python modules …

c++ python boost-python python-c-api python-embedding
"AttributeError: 'module' object has no attribute 'argv'" when using Python.h

When messing around with Python.h I got this error: AttributeError: 'module' object has no attribute 'argv' C++ code: #include "…

python c++ python-c-api python-embedding
Python Embedding: PyImport_Import not from the current directory

using the next line pModule = PyImport_Import(pName); Only load modules from the current directory. But what I want to …

python c python-embedding