printing list containing unicode string

Xah Lee xah at xahlee.org
Mon Sep 10 09:59:53 EDT 2007


If i have a nested list, where the atoms are unicode strings, e.g.

# -*- coding: utf-8 -*-
ttt=[[u"→",u"↑"], [u"αβγ"],...]
print ttt

how can i print it without getting the u'\u1234' notation?
i.e. i want it print just like this: [[u"→"], ...]

I can of course write a loop then for each string use
"encode("utf-8")", but is there a easier way?

Thx.

  Xah
  xah at xahlee.orghttp://xahlee.org/




More information about the Python-list mailing list