Decorator for main method 1.0

Version: 1.0

Downloads:0

Hits:366

SourceNO

Link Broken:Report It!

Package:Without source

Price:$0

More info Download

Description

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.

Language: Python

Related:

Clean Code - Code - Decorator - Main Method Decorator - Method - Object Oriented Programming

User Reviews:

Write Review *
Your name *
Email *
(Your comments will be reviewed by our staff before they are posted)
Rate this product *
Captcha Image
Enter code from image *

 

Related:

Right method names suggestion 1.2

This script uses __getattr__ to modify the error messages given when a wrong class method is called.

By: code.activestate.com Homepage

Freeware

A simple date class 1.0

This script can be used by anyone who wants a date object for a program.

By: code.activestate.com Homepage

Freeware

Importing a dynamically generated module 1.0

This script will let you import a module from code that is dynamically generated.

By: code.activestate.com Homepage

Freeware

Class with default method handler 1.0

This script is a class whose objects can handle undefined method calls, passing them on to a default handler.

By: code.activestate.com Homepage

Freeware

Method call when exit "with" statement 1.0

This script provides a context manager that allows the user to specify a method on the passed-in object to be called when the 'with' statement is...

By: code.activestate.com Homepage

Freeware

The Hush Programming Language 0.8.4

Hush is a full object-oriented programming language, based looselyon Smalltalk.

By: Hush Homepage

Freeware

ESOE - ECMAScript Object-Oriented Engine 1.0

This project defines a method of object-oriented programming with ECMAScript 3rd compatible language.

By: Esoe Homepage

Freeware

OOC-GCC 1.0

An easy to use template for Object Oriented Programming with Pure C !

By: Ooc-gcc Homepage

Freeware

S13 Programming Language Converter 1.0

An easy-to-use, plug-in based source code converter designed for object-oriented programming languages.

By: S13langconvert Homepage

Freeware

Php Object Generator 1.0

Php Object Generator is an open source PHP code generator which generates clean & tested Object Oriented code for your PHP4/PHP5 application.

By: phpobjectgenerator.com Homepage

Freeware