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
+4.3k Golang : Calculate half life decay example
+10.9k Golang : Simple client-server HMAC authentication without SSL example
+33.8k Golang : Strip slashes from string example
+19.7k Golang : Create and resolve(read) symbolic links
+24.1k Golang : Convert IP address string to long ( unsigned 32-bit integer )
+6.2k Golang : Validate credit card example
+3.8k Linux : sudo yum updates not working
+18.7k Android Studio : AlertDialog and EditText to get user string input example
+10.2k Use systeminfo to find out installed Windows Hotfix(s) or updates
+4.6k Javascript : Shuffle or randomize array example
+10.7k Golang : Gorilla web tool kit secure cookie example
+4.1k Golang : Print instead of building pyramids