Skip to content

Commit 65e59f8

Browse files
author
grange
committed
hello.py 작성
1 parent 0e73a0d commit 65e59f8

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

01_hello/hello.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/opt/homebrew/anaconda3/bin/python3
2+
# Purpose: Say hello
3+
4+
import argparse
5+
6+
7+
def get_args():
8+
parser = argparse.ArgumentParser(description='Say hello')
9+
parser.add_argument('-n', '--name', metavar='name',
10+
default='World', help='Name to greet')
11+
return parser.parse_args()
12+
13+
14+
def main():
15+
args = get_args()
16+
print('Hello, ' + args.name + '!')
17+
18+
19+
if __name__ == '__main__':
20+
main()

0 commit comments

Comments
 (0)