diff --git a/.gitignore b/.gitignore index 3c3629e64..3e5cc695e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +.venv/ \ No newline at end of file diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100755 index 000000000..70b5df217 --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +import cowsay +import argparse + +#getting avalble animal list +animals = cowsay.char_names + +parser = argparse.ArgumentParser( + prog="cowsay program", + description="Make animals say things" +) + +parser.add_argument( + "--animal", + default="cow", + choices=animals, + help=f"The animal to be saying things (choose from: {', '.join(animals)})" +) +parser.add_argument( + "message", + nargs="+", + help="message to show") + +args = parser.parse_args() + +text = " ".join(args.message) +animal = args.animal + +getattr(cowsay, animal)(text) \ No newline at end of file diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 000000000..c6b9ffd0e --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay