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
+8.1k Golang : Add text to image and get OpenCV's X, Y co-ordinates example
+8.9k Golang : How to get ECDSA curve and parameters data?
+5.6k Golang : Shuffle array of list
+9.7k Golang : Check a web page existence with HEAD request example
+9.3k Golang : Sort and reverse sort a slice of floats
+5.8k Golang : Get Hokkien(福建话)/Min-nan(閩南語) Pronounciations
+19.4k Golang : Determine if directory is empty with os.File.Readdir() function
+13.8k Android Studio : Use image as AlertDialog title with custom layout example
+10.7k Golang : Intercept and process UNIX signals example
+11.7k Golang : Simple client-server HMAC authentication without SSL example
+22.3k Golang : simulate tail -f or read last line from log file example
+11.7k Golang : flag provided but not defined error