Skip to content

Commit a4efcab

Browse files
committed
completed 01
1 parent f9151ba commit a4efcab

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

01_hello/hello.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
3+
import argparse
4+
5+
6+
def main():
7+
parser = argparse.ArgumentParser(description="Say hello")
8+
parser.add_argument(
9+
"-n",
10+
"--name",
11+
metavar="name",
12+
type=str,
13+
default="World",
14+
help="The name to greet (default: World)",
15+
)
16+
args = parser.parse_args()
17+
print(f"Hello, {args.name}!")
18+
19+
20+
if __name__ == "__main__":
21+
main()
22+

0 commit comments

Comments
 (0)