We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b49d04 commit e82a316Copy full SHA for e82a316
01_hello/hello.py
@@ -0,0 +1,27 @@
1
+#!/usr/bin/env python3
2
+'''
3
+Author: Gary Netherton w/guidance from KYClark
4
+Purpose: Say hello
5
6
+
7
+import argparse
8
9
10
+def get_args():
11
+ '''Get command line arguments'''
12
+ parser = argparse.ArgumentParser(description = 'Say hello')
13
+ parser.add_argument('-n', '--name',
14
+ metavar ='name',
15
+ default = "World",
16
+ help= 'Name to greet')
17
+ return parser.parse_args()
18
19
+def main():
20
+ '''Main function'''
21
22
+ args = get_args()
23
+ print("Hello, " + args.name + "!")
24
25
+# ----------------------------------------------------------
26
+if __name__ == '__main__':
27
+ main()
0 commit comments