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
+4.6k Javascript : Access JSON data example
+12.1k Golang : Get remaining text such as id or filename after last segment in URL path
+7.2k Golang : Fixing Gorilla mux http.FileServer() 404 problem
+7.3k Golang : Example of custom handler for Gorilla's Path usage.
+10k Golang : Compare files modify date example
+12.5k Golang : Get absolute path to binary for os.Exec function with exec.LookPath
+8.1k Android Studio : Rating bar example
+14.4k Golang : Find network of an IP address
+29.8k Golang : How to declare kilobyte, megabyte, gigabyte, terabyte and so on?
+12.6k Golang : Pass database connection to function called from another package and HTTP Handler
+8.1k Golang : Metaprogramming example of wrapping a function
+8.4k Android Studio : Import third-party library or package into Gradle Scripts