From 3dc7b202136078a4ddbc13ff4ef627667e7d54f5 Mon Sep 17 00:00:00 2001 From: Abubakar-Meigag <113248042+Abubakar-Meigag@users.noreply.github.com> Date: Sat, 6 Jun 2026 01:54:55 +0100 Subject: [PATCH] London | 26-Mar-SDC | beko | Sprint 4| implement cosway --- implement-cowsay/.gitignore | 2 ++ implement-cowsay/cow.py | 21 +++++++++++++++++++++ implement-cowsay/requirements.txt | 1 + 3 files changed, 24 insertions(+) create mode 100644 implement-cowsay/.gitignore create mode 100644 implement-cowsay/cow.py create mode 100644 implement-cowsay/requirements.txt diff --git a/implement-cowsay/.gitignore b/implement-cowsay/.gitignore new file mode 100644 index 000000000..83bf45394 --- /dev/null +++ b/implement-cowsay/.gitignore @@ -0,0 +1,2 @@ +.venv +.vscode/* \ No newline at end of file diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 000000000..846a33928 --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,21 @@ +import argparse +import cowsay + +available_animals = cowsay.CHARS + +parser = argparse.ArgumentParser(prog="cowsay", description="Make animals say things") +parser.add_argument("message", nargs="+", help="here is the message that the animal will say") +parser.add_argument( + "--animal", + choices=available_animals.keys(), + default="cow", + help="The animal to be saying things.", +) + +args = parser.parse_args() + +message_joined = " ".join(args.message) + +animal = args.animal + +getattr(cowsay, animal)(message_joined) \ No newline at end of file diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 000000000..cc5571034 --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay \ No newline at end of file