updated contents from Atlas repo

This commit is contained in:
Luciano Ramalho
2014-10-14 14:26:55 -03:00
parent 40688c038d
commit 981d5bc473
157 changed files with 71134 additions and 1 deletions

23
strings-bytes/charfinder.py Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env python
from unicodedata import name
import sys
if len(sys.argv) > 1:
query = sys.argv[1:]
else:
query = input('search words: ').split()
query = [s.upper() for s in query]
count = 0
for i in range(20, sys.maxunicode):
car = chr(i)
descr = name(car, None)
if descr is None:
continue
words = descr.split()
if all(word in words for word in query):
print('{i:5d} {i:04x} {car:^5} {descr}'.format(**locals()))
count += 1
print('{0} character(s) found'.format(count))