""" example.py DoesSomething to infilename Producing outfilename Usage: example.py infileName outfileName Example: example.py in.txt out.txt """ def main(argv=None): N_ARGS = 2 import sys if argv == None: argv=sys.argv args = argv[1:] #NOTE: args[0] != argv[0] == if len(args) != N_ARGS or "-h" in args or "--help" in args: print __doc__ sys.exit(2) print 'we did example.py to ' + str(args[0]) + ' yielding ' + str(args[1]) if __name__ == '__main__': sys.exit(main())