PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
sort-test.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 import sys, string, locale
4 locale.setlocale(locale.LC_ALL, "")
5 
6 if len(sys.argv) <> 2:
7  sys.stderr.write("Usage: sort.py filename\n")
8  sys.exit(1)
9 
10 infile = open(sys.argv[1], 'r')
11 list = infile.readlines()
12 infile.close()
13 
14 for i in range(0, len(list)):
15  list[i] = list[i][:-1] # chop!
16 
17 list.sort(locale.strcoll)
18 print string.join(list, '\n')
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
Definition: regc_locale.c:416