boost-python Questions

1

Solved

I want to set a Python variable from C++ so that the C++ program can create an object Game* game = new Game(); in order for the Python code to be able to reference this instance (and call functions...
Bethought asked 23/11, 2015 at 17:57

4

I am trying to use c++11 lambdas as accessor functions in boost::python's add_property, something along the following (the lambda is not strictly needed in this example, but will be needed for more...
Sclerotic asked 30/5, 2013 at 20:42

1

Solved

I try to embed a Python script into my C++ program. After reading some things about embedding and extending I understand how to open my own python script and how to pass some integers to it. But no...
Thorvaldsen asked 16/9, 2015 at 9:13

2

Solved

I am trying to build a Python module in C++ that transforms a 2D vector into a Numpy 2D array. What is incorrect here - presumably there is some transformation needed to a boost python object from ...
Thremmatology asked 17/7, 2015 at 5:6

1

at work I have the task to convert a large library with Python 2.7 Code to Python 3.x. This library contains a lot of scripts and extensions made with boost python for C++. All of this is built w...
Armijo asked 21/8, 2015 at 8:36

1

Solved

I have a tiny Python script which (in my eyes) makes threading.Thread.start() behave unexpectedly since it does not return immediately. Inside a thread I want to call a method from a boost::python...
Island asked 16/7, 2015 at 14:3

2

Solved

I'm implementing a Python extension module using Boost.Python. The module should define its own custom exception classes that inherit Exception. How do I do that?
Bela asked 8/3, 2012 at 15:34

0

I'm trying to make Boost Python require that arguments are named by the caller. As Python 3 implements PEP 3102, I can easily do that in pure Python: def foo(*, name=None, age=None): print("%s i...
Rebbecarebbecca asked 14/4, 2015 at 13:17

1

I've been trying to compile the Boost.Python 'quickstart' ($BOOST_PATH\libs\python\examples\quickstart) examples and have run into an issue. First, my environment: OS: Windows 7 Ultimate 64 bit ...
Ozzy asked 23/3, 2013 at 21:50

2

Solved

I am working on a C++ library with Python bindings (using boost::python) representing data stored in a file. Majority of my semi-technical users will be using Python to interact with it, so I need ...
Orangery asked 22/11, 2014 at 12:44

2

Solved

So, I am trying to create a to_python converter that will allow me to return a boost::optional from an exposed function and have it treated as T if the optional is set and None if not. Based on a p...
Nickname asked 8/6, 2011 at 6:8

4

Solved

Finally I'm able to use std::vector in python using the [] operator. The trick is to simple provide a container in the boost C++ wrapper which handles the internal vector stuff: #include <boost...
Truditrudie asked 21/9, 2010 at 14:34

3

I have been embedding python into c++ and I would like to know if there is a way to find the type of the boost::python::object which is a result after executing a function of a python module. I hav...
Hayne asked 10/6, 2013 at 13:29

1

I begin learning to use boost python and have a rookie question. I would like to write a function that can tie the lifetime of its argument to its results, such that when I call r = func(a), the a...
Palladian asked 17/11, 2014 at 22:58

2

Solved

I have a struct that contains a C-style array data member. I'd like to have this struct exposed to Python, and this data member be accessible as a list in Python. struct S { char arr[4128]; }; ...
Schlesien asked 26/7, 2013 at 15:43

1

Solved

I have a Boost Python object py::object obj = whatever(); I want to print it using normal python rules. // I want the effect of print 'My object is ', obj std::cout << "My object is " &lt...
Szeged asked 16/12, 2014 at 19:40

4

Solved

I'm trying to get Boost Python to play nicely with std::shared_ptr. Currently, I'm receiving this error: Traceback (most recent call last): File "test.py", line 13, in <module> comp.place_...
Gyrfalcon asked 21/12, 2012 at 8:23

1

The following example from Boost.Python v1.56 shows how to embed the Python 3.4.2 interpreter into your own application. Unfortunately that example does not work out of the box on my configuration ...
Fuller asked 6/11, 2014 at 19:19

1

Solved

I want to wrap a function that returns a boost::optional<T>. That is, given: class Foo { boost::optional<T> func(); }; I'd like to wrap that somehow so that Python either gets a T b...
Logarithmic asked 21/10, 2014 at 23:12

1

Solved

I am trying to test boost python with example in official website. But It incurs so many errors... The below is my what i did and the errors. Download Boost1.55 with this. Add Eclipse library sea...
Commonable asked 12/10, 2014 at 18:19

1

I have a C++ application using Qt for the UI and I'm currently implementing python bindings so that the application is more scriptable for its users. I also want people to be able to write th...
Phonometer asked 19/8, 2014 at 10:48

1

Solved

I'm trying to create a helloWorld module for Python 3 in C++ using the boost::python library. Here is a CmakeList.txt: set(Python_ADDITIONAL_VERSIONS 3.4) find_package( PythonLibs 3.4 REQUIRED ) in...
Muttonchops asked 7/8, 2014 at 17:43

1

Solved

I want to expose the following C++ function to Python using Boost.Python: int* test1() { return new int(42); } // Now exposing the function with Boost.Python BOOST_PYTHON_MODULE(libtest1) { us...
Rugged asked 4/7, 2014 at 7:7

1

I am trying to build Boost.Python according to the instructions on the official website. My OS is Windows 7 64-bit, the compiler is MSVC11, the boost is 1.54. =================== Install Boost ==...
Naif asked 25/9, 2013 at 9:47

1

Solved

Can someone tell me if I'm doing anything wrong. I'm on Windows 7 using Visual Studio 2013 and I would like to be able to be able to setup a simple Boost.Python project. I don't know if I've made...
Hayden asked 20/5, 2014 at 14:59

© 2022 - 2024 — McMap. All rights reserved.