Skip to content

Commit d255992

Browse files
committed
cleanup
1 parent 8bcc985 commit d255992

18 files changed

+81
-358
lines changed

01_hello/hello.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

01_hello/hello04_sys_argv.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

01_hello/hello05_greet_function.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

01_hello/hello07_using_test.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

01_hello/hello08_formatted.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Author: Ken Youens-Clark <kyclark@gmail.com>
4+
Purpose: Say hello
5+
"""
6+
7+
import argparse
8+
9+
10+
# --------------------------------------------------
11+
def get_args():
12+
"""Get the command-line arguments"""
13+
14+
parser = argparse.ArgumentParser(description='Say hello')
15+
parser.add_argument('-n', '--name', default='World', help='Name to greet')
16+
return parser.parse_args()
17+
18+
19+
# --------------------------------------------------
20+
def main():
21+
"""Make a jazz noise here"""
22+
23+
args = get_args()
24+
print('Hello, ' + args.name + '!')
25+
26+
27+
# --------------------------------------------------
28+
if __name__ == '__main__':
29+
main()

01_hello/hello09_validating_argv.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

01_hello/hello10_help_flag.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

01_hello/hello11_argparse.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

01_hello/hello12_get_args.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)