Changeset 391 for python/trunk/Demo/scripts/find-uname.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Demo/scripts/find-uname.py
r2 r391 22 22 23 23 def main(args): 24 unicode_names = []24 unicode_names = [] 25 25 for ix in range(sys.maxunicode+1): 26 26 try: 27 unicode_names.append( (ix, unicodedata.name(unichr(ix))))27 unicode_names.append((ix, unicodedata.name(unichr(ix)))) 28 28 except ValueError: # no name for the character 29 29 pass 30 30 for arg in args: 31 31 pat = re.compile(arg, re.I) 32 matches = [( x,y) for (x,y) in unicode_names33 32 matches = [(y,x) for (x,y) in unicode_names 33 if pat.search(y) is not None] 34 34 if matches: 35 35 print "***", arg, "matches", "***" 36 for (x,y)in matches:37 print "%s (%d)" % (y,x)36 for match in matches: 37 print "%s (%d)" % match 38 38 39 39 if __name__ == "__main__":
Note:
See TracChangeset
for help on using the changeset viewer.