Re: how to pretty-print Python dict with unicode?

2010-08-04 Thread Vlastimil Brom
2010/8/5 kj : > > Is there a simple way to get Python to pretty-print a dict whose > values contain Unicode? (Of course, the goal here is that these > printed values are human-readable.) > > If I run the following simple script: > > from pprint import pprint > x = u'\u6c17\u304c\u9055\u3046' > pri

Re: how to pretty-print Python dict with unicode?

2010-08-04 Thread Benjamin Kaplan
On Wed, Aug 4, 2010 at 3:15 PM, kj wrote: > > > > Is there a simple way to get Python to pretty-print a dict whose > values contain Unicode?  (Of course, the goal here is that these > printed values are human-readable.) > > If I run the following simple script: > > from pprint import pprint > x =

how to pretty-print Python dict with unicode?

2010-08-04 Thread kj
Is there a simple way to get Python to pretty-print a dict whose values contain Unicode? (Of course, the goal here is that these printed values are human-readable.) If I run the following simple script: from pprint import pprint x = u'\u6c17\u304c\u9055\u3046' print '{%s: %s}' % (u'x', x) pri