From 2567a98de9c03cce137e9290f6e8f663b7149298 Mon Sep 17 00:00:00 2001 From: RahwaZeslusHaile Date: Sat, 29 Nov 2025 21:16:03 +0000 Subject: [PATCH 1/2] Ignore local virtual environment --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3c3629e6..274d0491 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +.venv \ No newline at end of file From 510d4249b9e02fc4063e83ddcda49d3751463abc Mon Sep 17 00:00:00 2001 From: RahwaZeslusHaile Date: Mon, 1 Dec 2025 13:46:24 +0000 Subject: [PATCH 2/2] Add Python cowsay CLI with animal selection and validation --- implement-cowsay/cowsay_script.py | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 implement-cowsay/cowsay_script.py diff --git a/implement-cowsay/cowsay_script.py b/implement-cowsay/cowsay_script.py new file mode 100644 index 00000000..5d8b7ec7 --- /dev/null +++ b/implement-cowsay/cowsay_script.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +import argparse +import cowsay +import sys + +def main(): + parser = argparse.ArgumentParser( + description="Make animals say things" + ) + parser.add_argument( + "message", nargs="+", help="The message to say." + ) + parser.add_argument( + "--animal", + default="cow", + help="The animal to be saying things." + ) + + args = parser.parse_args() + + text = " ".join(args.message) + animal = args.animal + + supported_animals = [ + "beavis", "cheese", "cow", "daemon", "dragon", "fox", + "ghostbusters", "kitty", "meow", "miki", "milk", "octopus", + "pig", "stegosaurus", "stimpy", "trex", "turkey", "turtle", "tux" + ] + + if animal not in supported_animals: + print(f"usage: cowsay [-h] [--animal {{{','.join(supported_animals)}}}] message [message ...]") + print(f"cowsay: error: argument --animal: invalid choice: '{animal}' (choose from {','.join(supported_animals)})") + sys.exit(1) + + output = cowsay.get_output_string(animal, text) + print(output) + +if __name__ == "__main__": + main()