Getting a dictionary from an object
Bruno Desthuilliers
bdesth.quelquechose at free.quelquepart.fr
Sun Jul 24 17:13:54 EDT 2005
*Grandmaster* Steven Bethard a écrit :
>
> How about something like:
> dict((name, getattr(obj, name)) for name in dir(obj))
>
...
voiceless-ly'rs
More information about the Python-list
mailing list