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
+29.6k Golang : Get time.Duration in year, month, week or day
+7.1k Golang : Fixing Gorilla mux http.FileServer() 404 problem
+7.3k Golang : How to stop user from directly running an executable file?
+47.4k Golang : Convert int to byte array([]byte)
+5.6k Golang : Fix opencv.LoadHaarClassifierCascade The node does not represent a user object error
+7.2k Golang : Individual and total number of words counter example
+13.2k Golang : Read from buffered reader until specific number of bytes
+5.6k Golang : Error handling methods
+30.6k Golang : Download file example
+8.4k Golang : Progress bar with ∎ character
+6.7k Golang : How to setup a disk space used monitoring service with Telegram bot