Questions tagged [boost-python]

Library for intuitive and tight integration between C++ and Python.

Boost::python is a C++ library offering seamless integration of C++ and Python with reference handling, built-in and user-defined two-way type conversions, Python/C++ exception translation, function overloading, exposing class hierarchies, docstring support and more.

1337 questions
0
votes
2 answers

Problems compiling Boost::Python

I want to use c++ numerical recipes on my python script but I am having some issues compiling some stuff in the Boost Python Libraries. Specificly I want to expose the amoeba function to python. I use Make rather than BJam. This is what I get when I…
0
votes
2 answers

Expose a class to Python and change it in Python as well

I've used Boost.Python to expose my class into Python. I want to change this class or override some parts of it in Python as well as what we can do on classes in Python by default.
Novin Shahroudi
  • 620
  • 8
  • 18
0
votes
1 answer

Make python library use another version of boost-python

I'm trying to install python-chess package to Python 3.3 on Ubuntu 13.04. Here is a link to github (https://github.com/niklasf/python-chess), it is also possible to install it using pip. When I install it to Python 2.7 (with pip or with setup.py…
Anton Guryanov
  • 12,109
  • 1
  • 15
  • 16
0
votes
1 answer

Static create methods in boost python

I am trying to create an object using boost python. The class definition (pseudocode): class Awrap : public A, public boost::python::wrapper { static std::shared_ptr Create(...) { ... } // inherited from A virtual double foo(...)…
ad_ad
  • 375
  • 3
  • 14
0
votes
1 answer

ensuring data-consistency of object

I'm having a problem with data-consistencies of objects e.g. how to deal with objects that get deleted while the user still has a reference to them. simple pseudo-code example node = graph.getNode(name) node.destroy() < -- node gets…
Seb
  • 173
  • 2
  • 2
  • 7
0
votes
2 answers

How to use 'boost_python-vc110-mt-gd-1_54.lib' in C++?

I am trying to use BoostPython to write a program in C++. My presettings are: a. Win32 Console Application. b. Property->C/C++->General->Additional Include Directories->C:\Python27\include;C:\Program Files\boost\boost_1_54_0; c.…
ChangeMyName
  • 7,018
  • 14
  • 56
  • 93
0
votes
1 answer

How to get all class attr names from derived class using boost::python?

I want to implement and use some class Base. In Python it would be like that: class Base: def Enumerate(self): d = [] for attr in dir(self): if not attr.startswith('__') and not callable(getattr(self, attr)): …
2r2w
  • 1,384
  • 1
  • 12
  • 29
0
votes
1 answer

Unable to Build Boost.python in Visual Studio 2008. Compilation gives error

I am in a HUGE depression now! I spend 2 days trying to use boost.python . PLEASE guide me! I will explain what I did. I have Winows 7 64 bit. The Python is 64 bit 2.7.3 installed at C:\Python27_amd64. Now, I take boost_1_54_0.zip and unzip in F:…
user2698178
  • 366
  • 2
  • 11
0
votes
2 answers

Looking for best way to Incorporate C++ dll with Python

I have a Python GUI application that needs to incorporate a somewhat complex C++ dll. I have looked into boost.python but was having difficulties as the program contains 5 separate C++ files and I have no prior C++ coding experience. I was able to…
gargarvin
  • 31
  • 5
0
votes
1 answer

Microsoft Visual Studios 2012 Can't open "python33.lib"

I'm using the Boost libraries in MicroSoft Visual Studios 2012 for a C++ program that is going to have Python embedded into it. The problem is when I try to Build Solution [F7]; I get this :: Error 1 error LNK1104: cannot open file 'python33.lib'…
0
votes
1 answer

boost::python::class: programatically obtaining the class name

I am using templated vistors to define unified interface for several classes. For the purposes of definint the __str__ and __repr__ methods, I would like to programatically obtain class name (the "X" in the referenced documentation) from the…
eudoxos
  • 18,545
  • 10
  • 61
  • 110
0
votes
2 answers

boost.python exposing members of members

I have the following (simplified) code: struct A { int intVal; char charVal; }; struct B { A* someObj; }; I will want to expose B::A::intVal, but the following dose not work: class_("someClass") .def_readonly("var",…
elyashiv
  • 3,623
  • 2
  • 29
  • 52
0
votes
2 answers

Installing pyvlfeat on Windows: cannot find -lboost_python-mt-py26

I'm trying to install pyvlfeat on python in Windows. For installing this module, I had to install boost.python. I installed and compiled the boost with bjam --with-python toolset=gcc --layout=tagged After this I tried to install pyvlfeat by python…
Aress
  • 177
  • 1
  • 5
  • 11
0
votes
1 answer

boost python runtime errors for what seem to be compile time issues - how effect performance?

With boost python, I was adding an attribute to my python wrapper where the value came from an enumerated type, for instance: scope().attr("myconstant")=some_namespace::some_class::some_enum_value; But I got a run time error when I imported my…
MrCartoonology
  • 1,997
  • 4
  • 22
  • 38
0
votes
0 answers

Segmentation fault in boost::python callback

I exposed two classes to python: BOOST_PYTHON_MODULE(client) { class_("Error") .def("GetErrorCode", &Error::GetErrorCode) .def("GetDescription", &Error::GetDescription) .def("__nonzero__", &Error::operator…
sgeorgiev
  • 49
  • 1
  • 3