A Friday 12 October 2007, Bryan Lawrence escrigué:
> Elias
>
> With your hint, I was able to do this:
> for a in ff:
> x= a._v_attrs
> l=x._f_list()
> for i in l: print x.__getattr__(i)
>
> I suspect there might be a more 'pytables' way of doing the last
> step, but I'm in business now.
Well, this is the most 'pytables' way to list the values of attributes
that I can think of. Most of variables in PyTables can be accessed
using the __getattr__ approach because it is generally better for
interactive introspection. However, I agree that, for programatic
uses, implementing a __getitem__ would look better:
for a in ff:
x = a._v_attrs
l = x._f_list()
for i in l:
print x[i]
I've added a ticket (http://www.pytables.org/trac/ticket/120) so that we
can consider this addition for next releases.
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users