Created
September 20, 2015 15:26
-
-
Save mikequentel/4ecc4c1e728f62378780 to your computer and use it in GitHub Desktop.
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
#!/bin/python | |
import sys | |
import os | |
import argparse | |
import getpass | |
from datetime import datetime | |
def about(): | |
script_dir = os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))).replace('\\','/') | |
rightnow = datetime.now().strftime("%Y-%m-%d_%H.%M.%S.%f") | |
print "script_dir: " + script_dir | |
print "Right now: " + rightnow | |
def do_it(a, c): | |
print "Parameters: " + str(a) + ", " + str(c) | |
def login(): | |
username = raw_input("Enter username: ") | |
passwd = getpass.getpass("Enter password: ") | |
def main(): | |
parser = argparse.ArgumentParser(description='What this does: ') | |
parser.add_argument('a', help='Optional: a | b') | |
parser.add_argument('c', help='c') | |
args = parser.parse_args() | |
a = args.a | |
c = args.c | |
do_it(a, c) | |
os._exit(0) | |
# Specifies name of main function. | |
if __name__ == "__main__": | |
sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment