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
+44.4k Golang : Encode image to base64 example
+9.9k Golang : Intercept and process UNIX signals example
+14.1k Golang : How to login and logout with JWT example
+17.8k Golang : How to make function callback or pass value from function as parameter?
+40.5k Golang : Convert []byte to image
+9.1k Fix ERROR 1045 (28000): Access denied for user 'root'@'ip-address' (using password: YES)
+10.4k SSL : The certificate is not trusted because no issuer chain was provided
+17.9k Golang : Clearing slice
+8.4k Golang : Accessing content anonymously with Tor
+14.9k Golang : Find out mime type from bytes in buffer
+9.7k Golang : Simple image viewer with Go-GTK