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
+11k Golang : Send data to /dev/null a.k.a blackhole with ioutil.Discard
+10.4k Golang : Byte format example
+19.8k Golang : For loop continue,break and range
+6k Golang : Get Alexa ranking data example
+39.7k Golang : How to check if a string contains another sub-string?
+6.4k Golang : Create zip/ePub file without compression(use Store algorithm)
+5.5k Unix/Linux : Use netstat to find out IP addresses served by your website server
+5.5k Golang : Combine slices of complex numbers and operation example
+20.8k Golang : Securing password with salt
+21k Golang : Repeat a character by multiple of x factor
+4.1k Python : Convert(cast) bytes to string example
+5.1k AWS S3 : Prevent Hotlinking policy