Python : Print unicode escape characters and string
Couple of examples on how to print unicode string in Python. Nothing fancy, but it helps to explore the ways to print unicode characters in Python.
# - *- coding: utf- 8 - *-
print " 我爱你"
print u'\u0420\u043e\u0441\u0441\u0438\u044f'
goodmorning = "おはよう"
print (goodmorning)
Output :
我爱你
Россия
おはよう
Reference :
See also : Python : Fix SyntaxError: Non-ASCII character in file, but no encoding declared
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+9.9k Golang : Fix go.exe is not compatible with the version of Windows you're running
+6.8k Golang : Command line ticker to show work in progress
+15.2k Golang : Find out mime type from bytes in buffer
+27.6k Golang : Detect (OS) Operating System
+5.2k Golang : Calculate US Dollar Index (DXY)
+11.6k Golang : Covert map/slice/array to JSON or XML format
+20.9k Golang : Join arrays or slices example
+6.5k Golang : Not able to grep log.Println() output
+16.5k Golang : Clone with pointer and modify value
+5.6k Golang : Test input string for unicode example
+5.3k Golang : Scan forex opportunities by Bollinger bands
+7.6k Golang : Count leading or ending zeros(any item of interest) example