2
votes
1answer
617 views

What does error_already_set in Boost.python do and how to handle exceptions similarly in Python C API

I have been working on a project where I want to remove the boost dependencies and replace it with the Python C API. I spent some time understanding the Python C API and I saw this catch (...
2
votes
1answer
676 views

Unable to import a custom DLL in python

I am trying to expose a C++ class to python with boost::python, so I am going through this tutorial. I created a visual studio .dll project, with this source code: #include <boost/python.hpp> ...
1
vote
1answer
557 views

Py_InitModule with multiple functions - invalid conversion from int to PyCFunction

I am transitioning to removing the boost-python dependencies in my code, and I have made to to the "final step" of this transition (I removed all other boost dependencies, and when I comment out the ...
2
votes
1answer
2k views

How to convert boost python list to PyObject

I need to build a numpy array into C++ program bp::list py_points; // some code .... and in some part of the code I need to convert py_points to a PyObject * type to evaluate a python module ...
0
votes
1answer
229 views

Embedding Python 3.3 in a C++ program while only able to read one line at a time from input

I am currently working on adding embedded Python support (and yes, extending is not an option) to a large program as part of my summer internship. Ideally, I can keep the Python support within a ...
5
votes
0answers
471 views

Optimising boost::python::object instances

I recently started using Boost's Python library to wrap parts of a rather large C++ library. Quite by chance, I discovered that every Python object created by Boost Python, is at least bigger than ...
2
votes
0answers
526 views

Register non-static method with PyMethodDef

I am looking for a way to register non static methods of my MyWidget class as python methods. MyWidget class is a QWidget class and it's on the main window. So I want to initialize python when the ...
2
votes
1answer
532 views

Dynamically loading a python module from a DLL with Boost.Python

I have a DLL written in C++ that uses Boost.Python to run Python code. The Python code should be able to interact with the actual application (in the DLL). Is it possible to have both in one library ...
1
vote
1answer
182 views

Wrapping a piece of C++ code into Python

I have a piece of C++ code that generates the data. I want to expose the data to Python. But it is not as trivial as it sounds... Say this C++ compiles into binaries cppcode. Because of the ...
9
votes
6answers
6k views

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 from a particular directory. I want to modify the PYTHONPATH for my process so that ...

Can I help?

Ask the duck!

You’ll need to explain your problem.
Do you have a microphone?

Quack Overflow is listening…

Explain your problem out loud. Speak naturally.

With the magic of the internet,
you can just explain your problem anyway!
Speak naturally.

Can you speak up a little?

The duck is thinking about your problem…

The duck is typing…

Quack Overflow says,

“Whenever you’re stuck, rubber ducking is a powerful method for solving even the most difficult problems. Insights are often found by simply describing the problem aloud.”

The duck is sorry to hear that, but it understands.