jeudi 14 juillet 2016

Unicode output in ipython notebook


I have to work with Unicode (cyrillic) characters in IPython Notebook. Are there any way to output strings in Unicode, not their unicode or utf8 codes? I'd like to have ["АБ","ВГ"] as output in the last two examples below. In [62]: "АБВ" Out[62]: 'xd0x90xd0x91xd0x92' In [63]: u"АБВ" Out[63]: u'u0410u0411u0412' In [64]: print "АБВ" АБВ In [65]: print u"АБВ" АБВ In [66]: print ["АБ","ВГ"] ['xd0x90xd0x91', 'xd0x92xd0x93'] In [67]: print [u"АБ",u"ВГ"] [u'u0410u0411', u'u0412u0413']

Aucun commentaire:

Enregistrer un commentaire