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
+26.7k Golang : Get executable name behind process ID example
+10.5k Golang : Embed secret text string into binary(executable) file
+15k Golang : Get URI segments by number and assign as variable example
+14k Golang : unknown escape sequence error
+9.2k Golang : Gonum standard normal random numbers example
+4.5k Linux/MacOSX : Search and delete files by extension
+9k Golang : Executing and evaluating nested loop in html template
+14.3k Golang : Check if a file exist or not
+21.1k Golang : Underscore or snake_case to camel case example
+48.8k Golang : Upload file from web browser to server
+4.6k Java : Generate multiplication table example
+22.9k Golang : Round float to precision example