Boost.python: extracting an array

View: New views
1 Messages — Rating Filter:   Alert me  

Boost.python: extracting an array

by Randolph Fritz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there any way to extract a vector of floats from a python array?

In Python, can I write something like:
  from array import array
  from bpclass import foo

  vec = array('f', (1,2,3))
  foo ([vec])

And, in C++:
  void bpclass::foo (list v) {
    ... extract< {magic} >(v[0]) ...

Or would it be better to replace the array with a list?
--
Randolph Fritz
  design machine group, architecture department, university of washington
rfritz@... -or- rfritz333@...

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@...
http://mail.python.org/mailman/listinfo/cplusplus-sig