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
+28.1k Golang : Read, Write(Create) and Delete Cookie example
+11.7k Golang : Determine if time variables have same calendar day
+14.8k JavaScript/JQuery : Detect or intercept enter key pressed example
+8.2k Golang : Generate Datamatrix barcode
+5.8k Golang : Compound interest over time example
+16.1k Golang : Find out mime type from bytes in buffer
+9.4k Random number generation with crypto/rand in Go
+25k Golang : Convert long hexadecimal with strconv.ParseUint example
+5.7k Golang : Use NLP to get sentences for each paragraph example
+8.7k Golang : Sort lines of text example
+20.4k Golang : Read directory content with os.Open
+24.8k Golang : Generate MD5 checksum of a file