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 : Convert source code to assembly language
+7.4k Golang : How to convert strange string to JSON with json.MarshalIndent
+14.6k Golang : Execute function at intervals or after some delay
+8.3k Golang : Metaprogramming example of wrapping a function
+5.5k How to check with curl if my website or the asset is gzipped ?
+18.8k Golang : Implement getters and setters
+13.2k Golang : Convert(cast) uintptr to string example
+23.2k Golang : Print out struct values in string format
+18.6k Golang : Set, Get and List environment variables
+6.4k Javascript : Generate random key with specific length
+13.2k Golang : Handle or parse date string with Z suffix(RFC3339) example
+10.9k Golang : Sieve of Eratosthenes algorithm