Skip to content

Instantly share code, notes, and snippets.

@y-gagar1n
Created June 15, 2013 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y-gagar1n/5788834 to your computer and use it in GitHub Desktop.
Save y-gagar1n/5788834 to your computer and use it in GitHub Desktop.
Python - Print cyrillic symbols
import sys
import pprint
def pretty_print(object):
class decoder_stream:
def write(self, s):
if s.startswith("'") and s.endswith("'"):
s = "'%s'" % s[1:-1].decode('string_escape')
elif s.startswith("u'") and s.endswith("'"):
s = "u'%s'" % s[2:-1].decode('unicode_escape').encode('utf8')
sys.stdout.write(s)
pprint.pprint(object, decoder_stream())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment