Skip to content

Commit 90c631f

Browse files
committed
added positional arguments
1 parent 63d0a5f commit 90c631f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

01_hello/hello.py

100644100755
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
print('Hello, World!')
1+
#!/usr/bin/env python3
2+
# Purpose: Say Hello
3+
4+
import argparse
5+
6+
parser = argparse.ArgumentParser(description='Say hello')
7+
parser.add_argument('name', help='Name to greet')
8+
9+
args = parser.parse_args()
10+
11+
print('Hello, ' + args.name + '!')
12+

0 commit comments

Comments
 (0)