Hi Ignasi,
We are passing python lists to C++ in the DEM Application, and we are doing it like this:
We send the argument as a Python standard list, then we receive it as an argument of type 'boost::python::list& arg1'.
You can loop through the list using a standard for: for(int i=0; i<boost::python::len(arg1); i++) { }
And for every component, you can extract the value by doing: boost::python::extract<double>(arg1[i])
If your list contains strings, probably you should do boost::python::extract<std::string>(arg1[i])
or boost::python::extract<const std::string>(arg1[i])
, but I did not test this.
The bad thing of this approach is that you must know the type of each component of the list. So it is not as robust as I woul like, but it is working for us.
Best regards,
Miguel Angel