Hi there,
In a python script, I would like to iterate over things like get_gain_names, get_gain_ranges, ...
The problem is that these functions return a std::vectorstd::string *. The error i get is: TypeError: 'SwigPyObject' object is not iterable
It would be very nice to be able to do something like: for src.get_sample_rates(): # do something for name in get_gain_names(): # do smth
I found this: http://reference-man.com/files/generators.i But i haven't been able to use it so far. :(
Any help or comments appreciated.
Chris
Hi Christian,
please try the latest master, it should work now with the last commit.
Best regards,
Dimitri
On Sun, 05 Aug 2012 21:10:54 +0200, Christian Gagneraud chris@techworks.ie wrote:
Hi there,
In a python script, I would like to iterate over things like get_gain_names, get_gain_ranges, ...
The problem is that these functions return a std::vectorstd::string *. The error i get is: TypeError: 'SwigPyObject' object is not iterable
It would be very nice to be able to do something like: for src.get_sample_rates(): # do something for name in get_gain_names(): # do smth
I found this: http://reference-man.com/files/generators.i But i haven't been able to use it so far. :(
Any help or comments appreciated.
Chris
On 05/08/12 20:52, Dimitri Stolnikov wrote:
Hi Christian,
please try the latest master, it should work now with the last commit.
Thanks for the information, i'll give it a try!
Chris
Best regards,
Dimitri
On Sun, 05 Aug 2012 21:10:54 +0200, Christian Gagneraud chris@techworks.ie wrote:
Hi there,
In a python script, I would like to iterate over things like get_gain_names, get_gain_ranges, ...
The problem is that these functions return a std::vectorstd::string *. The error i get is: TypeError: 'SwigPyObject' object is not iterable
It would be very nice to be able to do something like: for src.get_sample_rates(): # do something for name in get_gain_names(): # do smth
I found this: http://reference-man.com/files/generators.i But i haven't been able to use it so far. :(
Any help or comments appreciated.
Chris