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
+17.2k Golang : How to get hour, minute, second from time?
+6.6k Golang : What fmt.Println() can do and println() cannot do
+9.1k Golang : Random Rune generator
+5.2k Javascript : Get operating system and browser information
+9.3k Generate Random number with math/rand in Go
+31.3k Golang : Regular Expression for alphanumeric and underscore
+7.2k Golang : Emulate NumPy way of creating matrix example
+5.7k Golang : Derive cryptographic key from passwords with Argon2
+5.7k Golang : Calculate pivot points for a cross
+6.6k Golang : Shuffle strings array
+10.7k Golang : convert(cast) float to string
+5.2k Golang : Get missing location after unmarshal binary and gob decode time.