How to print strings escaped?
Example:
text_str = "żółć"
text_unicode = u"żółć"
print function(text_str)
'\xc5\xbc\xc3\xb3\xc5\x82\xc4\x87'
print function(text_unicode)
u'\u017c\xf3\u0142\u0107'
so, what function should I use?
updated I need more than escape, because I need this in log, and throwing escaped sometimes leads me to unescaped results