Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8d7c9b

Browse files
committed
ch01: add docstrings
1 parent ca2b9c6 commit c8d7c9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

01_hello/hello.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#!/usr/bin/env python
2-
# Purpose: Say hello
2+
"""
3+
Author: Jeffrey Schmid-Paz
4+
Purpose: Say hello
5+
"""
36

47
import argparse
58

69

710
def get_args():
11+
"""Get the command-line arguments"""
812
parser = argparse.ArgumentParser(description="Say hello")
913
parser.add_argument(
1014
"-n", "--name", metavar="name", default="World", help="Name to greet"
@@ -13,6 +17,7 @@ def get_args():
1317

1418

1519
def main():
20+
"""Run the program"""
1621
args = get_args()
1722
print("Hello, " + args.name + "!")
1823

0 commit comments

Comments
 (0)