Re: [C++-sig] Miscellaneous Boost.Python Utilities

2011-07-06 Thread Brian O'Kennedy
Hi Jim, I've been trying out your python extensions and find them very useful to ease the wrapping process. I did however find a problem with the behaviour of the container_from_python_sequence converter. When having two overloaded functions, one of which expects a container of TestObjects and th

Re: [C++-sig] question about object

2010-09-01 Thread Brian O'Kennedy
I'm guessing it's the boost python equivalent of the Python code: >>> "%s is bigger than %s" % (NAME,name) The c++ statement is doing the same, via operator overloading. If we look at the statement bit-by-bit: object msg="%s is bigger than %s" % make_tuple(NAME,name);

Re: [C++-sig] [Py++] Undefined symbols for static const int member of class

2010-05-21 Thread Brian O'Kennedy
ly simply excluding those static const int members with mb.class_('someclass').variable('myvar').exclude() In that case, the particular class I'm wrapping works fine! Thanks Brian On 21 May 2010 12:49, Roman Yakovenko wrote: > > On Fri, May 21, 2010 at 1:

[C++-sig] [Py++] Undefined symbols for static const int member of class

2010-05-21 Thread Brian O'Kennedy
Hi, I'm wrapping a very simple class using PyPlusPlus. snip class testclass { public: static const int a = 99; }; /snip And Py++ exposes the static member with a def_readonly("a", testclass::a ) call. When I import this module into python I get an undefined symbol for

Re: [C++-sig] Boost and wxWidgets

2010-01-14 Thread Brian O'Kennedy
I suspect your problem is unrelated to boost.python. I've never used wxWidgets, but a quick google suggests it should be initialised before being used. *http://docs.wxwidgets.org/stable/wx_appinifunctions.html* int wxEntry(int& * argc*, w

Re: [C++-sig] Boost Python Tuple - Find length of tuple?

2010-01-04 Thread Brian O'Kennedy
You could try this instead: (untested!) using namespace boost::python; tuple a = make_tuple("hello", 42); std::cout << "Length = " << boost::python::len(a) << std::endl; // explicit namespace not needed hth, Brian 2010/1/4 Simon Pickles > Hello, > > I have a simple question

Re: [C++-sig] building modules with MSVC

2009-11-25 Thread Brian O'Kennedy
It's certainly possible. * Create a project in Visual Studio, set the output type to DLL. * Go to Linker->Output and name the DLL as mymodule.pyd (pyd's are just DLLs on Windows). * Set the Additional Library paths to where you keep your boost python stub lib for linking. * You might need to speci

Re: [C++-sig] Extending python and using debug interpreter on Linux

2009-04-22 Thread Brian O'Kennedy
++ integration Subject: Re: [C++-sig] Extending python and using debug interpreter on Linux Brian O'Kennedy wrote: > After diving deeper into boost.python and python than I felt comfortable > with, I found my own stupid mistake. > > On Windows, the presence of _DEBUG causes Py_DEBUG t

Re: [C++-sig] Extending python and using debug interpreter on Linux

2009-04-22 Thread Brian O'Kennedy
nces+brian.okennedy=vicon@python.org] On Behalf Of Brian O'Kennedy Sent: 21 April 2009 16:12 To: Cplusplus-sig@python.org Subject: [C++-sig] Extending python and using debug interpreter on Linux Hi, I've built a local copy of Python with PY_DEBUG enabled and tried import a simple module wh

[C++-sig] Extending python and using debug interpreter on Linux

2009-04-21 Thread Brian O'Kennedy
Hi, I've built a local copy of Python with PY_DEBUG enabled and tried import a simple module which only defs a single c++ function returning a std::string. My test involves importing the module, and then quitting the interpreter; I'm not trying to call anything in the module. This works as exp