"""example.py Module docstring. example.py DoesSomething to infilename Producing outfilename Usage: example.py infileName outfileName Example: example.py in.txt out.txt """ def process(args): print 'we did example.py to ' + str(args[0]) + ' yielding ' + str(args[1]) # http://www.artima.com/forums/flat.jsp?forum=106&thread=4829 find: Michael McFarland def main(): N_ARGS = 2 import sys args = sys.argv[1:] if len(args) != N_ARGS or "-h" in args or "--help" in args: print __doc__ sys.exit(2) process(args) #NOTE: args[0] != sys.argv[0] == if __name__ == '__main__': sys.exit(main())