6 print("usage: %s filename" % sys.argv[0])
12 for i in fi.readlines():
15 if i[1] == 'A' and i[3] == 'A':
18 if ord(i[0]) == 0xFEFF:
21 if i[0:2] == "\xFE\xFF": i = i[2:]
27 for i in range(0, min(len(a), len(b))):
29 if(a[i] > b[i]): return 1
30 if(a[i] < b[i]): return -1
33 def cmp_to_key(mycmp):
34 'Convert a cmp= function into a key= function'
36 def __init__(self, obj, *args):
38 def __lt__(self, other):
39 return mycmp(self.obj, other.obj) < 0
40 def __gt__(self, other):
41 return mycmp(self.obj, other.obj) > 0
42 def __eq__(self, other):
43 return mycmp(self.obj, other.obj) == 0
44 def __le__(self, other):
45 return mycmp(self.obj, other.obj) <= 0
46 def __ge__(self, other):
47 return mycmp(self.obj, other.obj) >= 0
48 def __ne__(self, other):
49 return mycmp(self.obj, other.obj) != 0
53 l.sort(key=lambda s: str.lower(s.replace(s[1], "")))
55 fo = open(f + "_sorted", 'w')