blob: 53019038ab1323a6843f92a0017b49e61231f56e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#! /usr/bin/env python
import sys, string, locale
locale.setlocale(locale.LC_ALL, "")
if len(sys.argv) != 2:
sys.stderr.write("Usage: sort.py filename\n")
sys.exit(1)
infile = open(sys.argv[1], 'r')
list = infile.readlines()
infile.close()
for i in range(0, len(list)):
list[i] = list[i][:-1] # chop!
list.sort(key=locale.strxfrm)
print('\n'.join(list))
|