Re: [C++-sig] Nested Boost::Python dictionaries

2012-05-12 Thread DarkAnt
Thanks Jim! On Sat, May 12, 2012 at 4:03 PM, Jim Bosch wrote: > On 05/12/2012 12:22 PM, DarkAnt wrote: >> >> I'm trying to create a boost::python::dict that stores another >> boost::python::dict. >> >> int main() >> { >>        Py_Initialize(); &

[C++-sig] Nested Boost::Python dictionaries

2012-05-12 Thread DarkAnt
I'm trying to create a boost::python::dict that stores another boost::python::dict. int main() { Py_Initialize(); boost::python::dict parent; try{ parent["child_dict"] = boost::make_shared(boost::python::dict()); } catch(...){

Re: [C++-sig] Boost::Python to_python converter

2012-04-03 Thread DarkAnt
Thanks a bunch Stefan! On Tue, Apr 3, 2012 at 12:01 PM, Stefan Seefeld wrote: > DarkAnt, > > the problem is that you don't initialize / import the newly defined > module. The attached version works fine for me. > >    Stefan > > -- > >      ...i

Re: [C++-sig] Boost::Python to_python converter

2012-04-03 Thread DarkAnt
I removed everything except int health and I still crash. If I do not have the explicit to_python converter I receive this error message: TypeError: No to_python (by-value) converter found for C++ type: Unit On Tue, Apr 3, 2012 at 11:20 AM, Stefan Seefeld wrote: > DarkAnt, > > have

[C++-sig] Boost::Python to_python converter

2012-04-03 Thread DarkAnt
I'm having a conceptual issue with the way C++ interfaces with Python. I'm trying to convert a C++ object to a Python object, but my attempt causes the program to crash. I suspect I'm doing a lot of things wrong. Ultimately I'd like to be able to pass C++ objects to a python function that modifies