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
+7.5k Golang : Random integer with rand.Seed() within a given range
+5.5k Mac/Linux/Windows : Get CPU information from command line
+18.3k nginx: [emerg] unknown directive "passenger_enabled"
+11.7k Golang : Calculate elapsed years or months since a date
+12.2k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+8.6k Golang : Get escape characters \u form from unicode characters
+4.2k Python : Delay with time.sleep() function example
+9.2k Swift : Convert (cast) String to Integer
+5.4k Golang : Calculate pivot points for a cross
+5.6k Mac OSX : Find large files by size
+19.5k Golang : How to get time zone and load different time zone?
+4.4k Linux/Unix/PHP : Restart PHP-FPM