Publisher review:Decorator for main method script shows how to do the same thing with a decorator that makes the code much cleaner. Decorator for main method script shows how to do the same thing with a decorator that makes the code much cleaner.This allows option and argument parsing to be hidden from the main code in your program. The user simply passes an optional getopt string and the number of required arguments. Then the actual main function get passed a dictionary of options and a list of arguments. One possible improvement would be to add an optional error handling routine passed to the decorator. As it is all exceptions are caught in the decorator function and printed to the screen.
Decorator for main method 1.0 is a Python script for Programming Methods and Algorithms scripts design by Matt Wallace.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
Decorator for main method script shows how to do the same thing with a decorator that makes the code much cleaner.
Operating system:Windows / Linux / Mac OS / BSD / Solaris