Skip to content

Commit bb29ebc

Browse files
committed
defined and implemented get_args()
1 parent d9fc882 commit bb29ebc

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

01_hello/hello.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33

44
import argparse
55

6-
7-
def main():
8-
6+
def get_args():
97
parser = argparse.ArgumentParser(prog='Hello World',
108
description='Say hello to my litle frient',
119
epilog='Text at the bottom of the help')
1210
parser.add_argument('-n', '--name', metavar='name',default='World', help='Name to greet')
1311

14-
args = parser.parse_args()
12+
return parser.parse_args()
13+
14+
15+
16+
def main():
17+
18+
args = get_args()
1519

1620
print('Hello, ' + args.name + '!')
1721

0 commit comments

Comments
 (0)