[python-win32] Converting types for deep lists or Discitonnaries

Tim Golden mail at timgolden.me.uk
Thu May 21 15:27:31 CEST 2009


Dominick Lauzon wrote:
> I need to convert a multi-level and multi-type list and dictionary (keys
> and values) to string format.
> 
> Is there a way to do this globally rather than iterating item to
> str(item)?

Not really a win32-specific question... but it's the kind
of thing which gets asked and answered fairly frequently
on the main python list:

  http://mail.python.org/mailman/listinfo/python-list

and in the ActiveState cookbook:

  http://www.activestate.com/ASPN/Python/Cookbook/

(the key terms are "flattening" and "pretty print")

and someone recently recommended Armin Ronachers pretty:

  http://lucumr.pocoo.org/2007/10/21/pretty-a-python-pprint-successor


TJG


More information about the python-win32 mailing list