Created
March 25, 2020 16:22
-
-
Save aSipiere/cb3b8e5fb2d68e506013f6d6e582d0c6 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
import foo | |
import argparse | |
def main(quux, quuz, **kwargs): | |
try: | |
if quux is True: | |
foo.bar() | |
else: | |
foo.baz() | |
except Exception as ex: | |
print(ex.message) | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--quux', '-qx', default='inf', help="'inf' == float('inf'), or #") | |
parser.add_argument('--quuz', '-qz', default='quuz.co', type=str, help='hostname or IP address') | |
args = parser.parse_args() | |
IM_A_CONSTANT_THAT_DEPENDS_ON_ARGS = ARGS.quux * 2 | |
main(IM_A_CONSTANT_THAT_DEPENDS_ON_ARGS, args.quuz) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment