Skip to content

Instantly share code, notes, and snippets.

@aSipiere
Created March 25, 2020 16:22
Show Gist options
  • Save aSipiere/cb3b8e5fb2d68e506013f6d6e582d0c6 to your computer and use it in GitHub Desktop.
Save aSipiere/cb3b8e5fb2d68e506013f6d6e582d0c6 to your computer and use it in GitHub Desktop.
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