Created
April 21, 2015 14:50
-
-
Save jamcut/34022c3919b782fb52b2 to your computer and use it in GitHub Desktop.
Simple base Python script template
This file contains 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 | |
import argparse | |
import sys | |
# uncomment to make use of colorprint | |
#try: | |
# from colorprint import * | |
#except: | |
# print("[-] Could not import colorprint. Install it by running 'git clone https://gist.github.com/2d61c414870b75168d56.git'") | |
# sys.exit(0) | |
def main(): | |
# setup arguments | |
parser = argparse.ArgumentParser(description='Put description here') | |
parser.add_argument('-f', '--file', help='input file for script to process') | |
parser.add_argument('-o', '--output', help='file to write output') | |
parser.add_argument('-v', '--verbose', help='show verbose output', action='store_true') | |
# add additional arguments here | |
# parse arguments | |
args = parser.parse_args() | |
# do some other stuff here | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment