Created
September 4, 2011 03:41
-
-
Save giodamelio/1192209 to your computer and use it in GitHub Desktop.
Python Template With Optparse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" | |
Program or module info | |
""" | |
__version__ = "0.1" | |
__author__ = "Gio d'Amelio([email protected])" | |
__license__ = "Public Domain" | |
import sys | |
import optparse | |
def main(): | |
""" | |
Main function and program description | |
""" | |
prog_args = sys.argv[1:] | |
parser = optparse.OptionParser() | |
opt, args = parser.parse_args(prog_args) | |
parser.print_help() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment