[python-uk] Boost.Python

Phil Hornby phil.hornby at accutest.co.uk
Fri Dec 19 08:00:32 EST 2003


Hi out there....

Okay wondering if any of the UK Pythoneers have played with Boost.Python??
If so do you mind if I pick your brain as the documentation/examples leave a
little to be desired in my opinion.

The trivial examples they give for things are fine but I am working on some
code that I have been using in a C++ way (I'm kinda in a half-way house
between C and C++ trying to be good and do one or the other but it is always
tempting to use the old tried and tested stuff) and well the simple approach
just doesn't work...or I am doing something really simply wrong...

I have a constructor that I pass an (unsigned char *) to the function with
an (unsigned char) to indicate the length of the data of interest - but I
know the pointer is always to an 8 byte array - I just ignore any bytes
after the value of my length. Boost.Python seems to let me create the code
and compile but when I try to use it in python I'm not sure what to pass in.
I have tried a tuple but it just laughs at me....

Also I have an array of (unsigned char) as a public member variable but when
I tell Boost.Python about it like below it won't compile...

>> .def_readwrite("data", &CcanMsg::data)

Any one know the solution?? Or do I need to start swamping my e-mail with
the main Python list....?

Thanks...
--
Phil Hornby
Accutest Ltd.
(01457) 891121
mailto::phil.hornby at accutest.co.uk




More information about the python-uk mailing list