PostgreSQL Source Code git master
sort-test.py
Go to the documentation of this file.
1#! /usr/bin/env python
2
3import locale
4import sys
5
6locale.setlocale(locale.LC_ALL, "")
7
8if len(sys.argv) != 2:
9 sys.stderr.write("Usage: sort.py filename\n")
10 sys.exit(1)
11
12infile = open(sys.argv[1], 'r')
13list = infile.readlines()
14infile.close()
15
16for i in range(0, len(list)):
17 list[i] = list[i][:-1] # chop!
18
19list.sort(key=locale.strxfrm)
20print('\n'.join(list))
void print(const void *obj)
Definition: print.c:36
const void size_t len
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
Definition: regc_locale.c:412