Skip to content

Commit d9fc882

Browse files
committed
added call to main
1 parent 96c8aae commit d9fc882

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

01_hello/hello.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33

44
import argparse
55

6-
parser = argparse.ArgumentParser(prog='Hello World',
7-
description='Say hello to my litle frient',
8-
epilog='Text at the bottom of the help')
96

10-
parser.add_argument('-n', '--name', metavar='name',default='World', help='Name to greet')
7+
def main():
118

12-
args = parser.parse_args()
13-
14-
print('Hello, ' + args.name + '!')
9+
parser = argparse.ArgumentParser(prog='Hello World',
10+
description='Say hello to my litle frient',
11+
epilog='Text at the bottom of the help')
12+
parser.add_argument('-n', '--name', metavar='name',default='World', help='Name to greet')
13+
14+
args = parser.parse_args()
15+
16+
print('Hello, ' + args.name + '!')
1517

18+
if __name__ == '__main__':
19+
main()

0 commit comments

Comments
 (0)