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.5k Linux/MacOSX : Search and delete files by extension
+13.6k Golang : Count number of runes in string
+8k Golang : How to feed or take banana with Gorilla Web Toolkit Session package
+6.8k Golang : Derive cryptographic key from passwords with Argon2
+5.8k Golang : Error handling methods
+14.6k Golang : Find network of an IP address
+20.6k Golang : Pipe output from one os.Exec(shell command) to another command
+5.9k Golang : Markov chains to predict probability of next state example
+4.8k Chrome : How to block socketloop.com links in Google SERP?
+5.8k Linux/Unix/PHP : Restart PHP-FPM
+18.6k Golang : Write file with io.WriteString
+7.6k Golang : Hue, Saturation and Value(HSV) with OpenCV example