epsas
public python v1 · immutable#!/usr/bin/env pythonfrom sys import argvimport commandsif __name__ == "__main__": try: source = argv[1] files = argv[2:] except: print "Usage: %s source_file file_to_compare_1 file_to_compare_2 . . ." % argv[0] print "The files with the lowest number are closest in content to source_file" raise SystemExit else: for f in files: count = commands.getoutput ( "diff %s %s | wc -l " % ( source, f) ) print count,f