#!/usr/bin/env python # Copyright 2005 Daniel Cer (daniel.cer@cs.colorado.edu) # # This work is licensed under the Creative Commons Attribution-NonCommercial- # ShareAlike License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to # Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, # 94105, USA. import sys if len(sys.argv) != 2: print >>sys.stderr, \ "Usage:\n\t%s (file with numbers to sort)" % sys.argv[0] sys.exit(-1) # read in the items items = [] fh = open(sys.argv[1]) for line in fh: items.append(float(line)) fh.close() # sort them items.sort() # display the results for item in items: print item