Boost logo

Boost Users :

Subject: Re: [Boost-users] How to send python list to c++ function
From: Guruswamy B M (guruswamy.1984_at_[hidden])
Date: 2012-04-20 02:47:20


Hi Thanks for the reply,
I have tried boost::python::object, I am able to access individual list
variable send from python also returning successfully to python. But I need
these object value to int, from there I can use further. So can u suggest
me how to access individual array elements as an int.
Thanks,
Guru

On Thu, Apr 5, 2012 at 8:15 PM, Dave Abrahams <dave_at_[hidden]> wrote:

>
> on Wed Apr 04 2012, Guruswamy B M <guruswamy.1984-AT-gmail.com> wrote:
>
> > Hi,
> >
> > I have been using boost python for one of my application. In the same
> > I have to send list from python to boost wrapper. Ex:.
> >
> >>From python.
> >
> > a = [1, 2, 3, 4]
> > test(a);
> >
> > In wrapper my C++ fucntion should be like below:
> >
> > void test(list a)
> > {
> > list processing.
> > }
> >
> > I tried similar way, but getting an signature error. I need a help on
> > how to send list from the python, so that can access each element of
> > list in C++ wrapper.
> >
> > Thanks and Regards,
> > Guru
>
> Is "list" above "boost::python::list"?
> If not, you might try that. If so, you might try replacing it with
> "boost::python::object"
>
> HTH,
>
> --
> Dave Abrahams
> BoostPro Computing
> http://www.boostpro.com
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net