From a4efcab5552200bf58c33b687cb5e47355b5d345 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Sun, 29 Nov 2020 17:03:04 -0500 Subject: [PATCH] completed 01 --- 01_hello/hello.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 01_hello/hello.py diff --git a/01_hello/hello.py b/01_hello/hello.py new file mode 100755 index 000000000..fcb04c334 --- /dev/null +++ b/01_hello/hello.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import argparse + + +def main(): + parser = argparse.ArgumentParser(description="Say hello") + parser.add_argument( + "-n", + "--name", + metavar="name", + type=str, + default="World", + help="The name to greet (default: World)", + ) + args = parser.parse_args() + print(f"Hello, {args.name}!") + + +if __name__ == "__main__": + main() +