diff --git a/.gitignore b/.gitignore index 68ca39690..3651c3703 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ tex2pdf* 19_wod/wod.py 20_password/password.py 21_tictactoe/tictactoe.py + +#my folders +.venv diff --git a/01_hello/hello.py b/01_hello/hello.py new file mode 100644 index 000000000..3be9b20ea --- /dev/null +++ b/01_hello/hello.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +""" +Author: Ken Youens-Clark +Purpose: Say hello +""" + +import argparse + + +# -------------------------------------------------- +def get_args(): + """Get the command-line arguments""" + + parser = argparse.ArgumentParser(description='Say hello') + parser.add_argument('-n', '--name', default='World', help='Name to greet') + return parser.parse_args() + + +# -------------------------------------------------- +def main(): + """Make a jazz noise here""" + + args = get_args() + print('Hello, ' + args.name + '!') + + +# -------------------------------------------------- +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/01_hello/test.py b/01_hello/test.py index d0cedd1c2..01759a0b0 100755 --- a/01_hello/test.py +++ b/01_hello/test.py @@ -4,7 +4,8 @@ import os from subprocess import getstatusoutput, getoutput -prg = './hello.py' +prg = 'hello.py' +#'./hello.py' # -------------------------------------------------- diff --git a/requirements.txt b/requirements.txt index 863bd103c..ae9a0af48 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,4 @@ black flake8 ipython mypy -pylint pytest -yapf