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
+6.3k Golang : Calculate how many weeks left to go in a given year
+5.3k Apt-get to install and uninstall Golang
+3.7k JavaScript: Add marker function on Google Map
+30.9k Golang : Convert []string to []byte examples
+9.6k Golang : Fix go.exe is not compatible with the version of Windows you're running
+8.9k Golang : Setting variable value with ldflags
+7.7k Golang : Gorilla web tool kit schema example
+6.1k Ubuntu : connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream
+48.7k Golang : Disable security check for HTTPS(SSL) with bad or expired certificate
+15.4k Golang : Set up source IP address before making HTTP request
+14.3k Golang : How to convert(cast) IP address to string?
+6.8k Golang : Error reading timestamp with GORM or SQL driver