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
+30.5k Golang : How to verify uploaded file is image or allowed file types
+10.7k Golang : Allow Cross-Origin Resource Sharing request
+46.6k Golang : Encode image to base64 example
+5.2k Linux : How to set root password in Linux Mint
+11.9k Golang : Verify Linux user password again before executing a program example
+21.9k SSL : How to check if current certificate is sha1 or sha2
+8.2k Golang : Randomize letters from a string example
+6.5k Golang : Handling image beyond OpenCV video capture boundary
+5.7k Unix/Linux : How to find out the hard disk size?
+9.6k Golang : Changing a RGBA image number of channels with OpenCV
+8.6k Golang : How to check variable or object type during runtime?
+17.5k Golang : Check if IP address is version 4 or 6