boost-python Questions
3
Solved
I have a series of C++ structures I am trying to wrap using boost python. I've run into difficulties when these structures contain arrays. I am trying to do this with minimal overhead and unfortuna...
Telmatelo asked 18/9, 2013 at 20:48
1
Solved
C++ Model
Say I have the following C++ data structures I wish to expose to Python.
#include <memory>
#include <vector>
struct mystruct
{
int a, b, c, d, e, f, g, h, i, j, k, l, m;
}...
Pomiculture asked 21/6, 2017 at 21:30
3
Solved
I'm trying to write a python wrapper for some C++ code that make use of OpenCV but I'm having difficulties returning the result, which is a OpenCV C++ Mat object, to the python interpreter.
I've ...
Parathion asked 18/10, 2012 at 14:51
1
Solved
I am wrapping C++ classes with boost-python and I am wondering is there is a better way to do it than what I am doing now.
The problem is that the classes have getters/setters that have the same n...
Contractual asked 28/5, 2017 at 20:22
1
Solved
I've been using Boost::Python for a while, and everything always turned out ok. However yesterday I was trying to find out why a particular type I thought I had registered (a tuple) was giving me e...
Preciado asked 12/2, 2017 at 11:25
1
Solved
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 (error_al...
Ghyll asked 29/3, 2017 at 12:49
2
I have an object that is held in a shared_ptr in C++. The object is accessed through the python bindings from within python and passed to another bound C++ function that tries to keep hold of it. I...
Imitative asked 31/8, 2012 at 1:11
1
Solved
In my application, I use boost_python and python 3.5.2. All built from source in Ubuntu 14.
When I built Python 3.5.2 from source with --with-shared options in Ubuntu, I got libpython3.so (7.6kB) ...
Eritrea asked 5/10, 2016 at 0:47
2
Solved
I need to speed up some algorithms working on NumPy arrays. They will use std::vector and some of the more advanced STL data structures.
I've narrowed my choices down to Cython (which now wraps mo...
Symbolism asked 23/1, 2017 at 19:7
2
Solved
How to expose std::pair to python using boost::python? When I expose for example vector<string> I simply write:
class_<std::vector<std::string> >("StringVec")
.def(vector_indexi...
Hemisphere asked 11/5, 2013 at 14:4
1
I'm writing a python program that includes a c++ module (.so, using boost.python).
I'm starting several python threads that run a c++ function.
This is how the C++ code looks like:
#include <...
Thousandth asked 14/12, 2016 at 0:44
1
Solved
I am successfully able to load a python script file and call a function within using boost::python in a C++ app.
In the boost python EmbeddingPython wiki there is a tip on how to load a python modu...
Pilsen asked 6/12, 2016 at 20:36
2
Solved
I am totally new to boost.python.
I reviewed a lot of recommending of using boost.python to apply with python, however still not easy to understand and find a solution for me.
What I want is to i...
Liborio asked 27/7, 2016 at 18:1
4
I'm using Boost Python library to create python extensions to my C++ code. I'd like to be able to invoke from python the 'greet' function from the C++ code shown below:
#include <boost/python/m...
Dardar asked 7/1, 2010 at 7:40
1
Solved
In order to expose a C++ exception to Python in a way that actually works, you have to write something like:
std::string scope = py::extract<std::string>(py::scope().attr("__name__"));
std::...
Rubbing asked 14/6, 2016 at 17:6
2
Solved
Sample code to illustrate:
struct Base
{
virtual int foo() = 0;
};
struct Derived : public Base
{
virtual int foo()
{
return 42;
}
};
Base* get_base()
{
return new Derived;
}
BOOST_PYTHON...
Condescending asked 18/11, 2013 at 18:15
1
Solved
I created a ring buffer and I want to import that class to Python using boost. When I am trying to that its getting error.
ring.cpp: In function ‘void init_module_ring()’:
ring.cpp:130:16: error:...
Ragman asked 9/5, 2016 at 9:17
1
When I run my code, I meet a problem about boost-python. Just like this:
dyld: Symbol not found: _PyBaseObject_Type
Referenced from: /opt/local/lib/libboost_python-mt.dylib
Expected in: flat names...
Sanborne asked 13/10, 2015 at 5:11
1
Is there a way to wrap boost::optional<T> type object to expose it via boost::python::class_ (used from BOOST_PYTHON_MODULE)
struct Foo
{
boost::optional<int> bar;
};
BOOST_PYTHON_...
Anatole asked 7/4, 2016 at 19:48
5
Solved
I would like to return some data from c++ code as a numpy.array object. I had a look at boost::python::numeric, but its documentation is very terse. Can I get an example of e.g. returning a (not ve...
Malliemallin asked 22/5, 2012 at 11:52
2
Solved
I'm trying to make so this code returns the same instance in both the init function and the callback function
test1.py
import test1
c = test1.C()
print 'init:', c
def func(c):
print 'func:', c...
Nominative asked 24/3, 2016 at 12:33
2
I am trying to install PyFTGL on MacOSX Yosemite.
The python version I am using is 2.7 from macports. I have installed boost from macports specifying +python27.
To install PyFTGL I built from so...
Rhapsody asked 21/4, 2015 at 15:56
2
Solved
I have code to extract a numeric value from a python sequence, and it works well in most cases, but not for a numpy array.
When I try to extract an unsigned char, I do the following
unsigned char...
Candida asked 27/10, 2014 at 19:27
2
Solved
I'm currently trying to build on Windows (with Intel compiler) a big project compiling very well on UNIX with CMake. Here is a reduced simple example of my problem.
Running the following simple ex...
Aurelea asked 12/2, 2016 at 16:24
2
Solved
EDIT: Ok, all the edits made the layout of the question a bit confusing so I will try to rewrite the question (not changing the content, but improving its structure).
The issue in short
I have an...
Christopher asked 22/1, 2016 at 15:29
© 2022 - 2024 — McMap. All rights reserved.