Softpedia
 


SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Koken 0.8.2
  • ContentBox 1.5.2
  • jQPlayer 0.5.2
  • SPOILER ALERT! 0.0.2
  • jQuery Mask Plugin 0.9.0
  • Easing Slider 2.1.2
  • Btapp.js 0.2.0
  • WiiFlash 0.4.5
  • Breeze.js 1.3.3
  • TinyMCE Templates 3.0.2
  • Home > Scripts > Programming Methods and Algorithms

    Decorator for main method 1.0

    Download button


    Downloads: 423  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.0/5)
    17 user(s)
    Developer:

    Website:

    License / Price:

    Platforms:

    Databases:

    Language:

    Last Updated:

    Category:
    Matt Wallace | More scripts
    aspn.activestate.com
    Other Free / Open Source License - Python License 

    Windows / Linux / Mac OS / BSD / Solaris
    N/A
    Python
    June 7th, 2007, 10:39 GMT
    C: \ Programming Methods and Algorithms

     Read user reviews (0)  Refer to a friend  Subscribe

    Decorator for main method description

    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.



    TAGS:

    main method decorator | clean code | object oriented programming | method | decorator | code

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM