On Wed, Sep 10, 2003 at 07:38:36AM -0700, Jerry McRae wrote:
> >>>> print vw[0]['stem']
> JK> 'tree'
> 
> JK> so that instead of the string 'stem' i can pass a variable holding a string
> JK> to index the desired column.
> 
> how 'bout...
> getattr(vw[0],'stem')

thanks jerry, that works perfectly! and i notice there's also a
corresponding setattr, which really makes my day. ;-)

(well, i guess the fact that i didn't know about getattr/setattr shows i
still have a lot to learn about python... guess i'll just dive into the
docs a bit more.)

-- 
Joost Kremers
Life has its moments

_______________________________________________
metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to