Speed up development with full-stack environments for every branch.

Learn More

Unicode in python

412 Runs 1595 Views 243 Copies
Saved

Saved

sundip 66

sundip
published 4 years ago

import unicodedata

###
# UNICODE DATABASE
# http://docs.python.org/2/library/unicodedata.html
###

print unicodedata.lookup('LEFT CURLY BRACKET')
print unicodedata.name(u'/')
print unicodedata.decimal(u'9')
#print unicodedata.decimal(u'a') # - returns a 'ValueError': not a decimal

print unicodedata.category(u'A')  # 'L'etter, 'u'ppercase
print unicodedata.bidirectional(u'\u0660') # 'A'rabic, 'N'umber
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).