diff --git a/implement-cowsay/.gitignore b/implement-cowsay/.gitignore new file mode 100644 index 00000000..4855549d --- /dev/null +++ b/implement-cowsay/.gitignore @@ -0,0 +1,4 @@ +.venv/ +.env +.env.* + diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 00000000..858c66e4 --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,23 @@ +import cowsay +import argparse + +listed_animals = cowsay.char_names + +parser = argparse.ArgumentParser( + prog="cow", + description="Makes animals say things", +) + +parser.add_argument("--animal", default="cow", help="Select an animal to say anything", choices=listed_animals) +parser.add_argument("message", nargs ="+", help="The message that the animal says") + +args = parser.parse_args() + +message = " ".join(args.message) +animal = args.animal + + +animal_says = getattr(cowsay, animal) + +print(animal_says(message)) + diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 00000000..9e063437 --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay==6.1