ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
[C++-sig] Boost.python: extracting an array
by Randolph Fritz other posts by this author
Oct 11 2009 9:15PM messages near this date
[C++-sig] Returning pointer to abstract class from pure virtual class method | [C++-sig] [python] Function objects in place of member functions
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@[...].edu -or- rfritz333@[...].com

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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved