From b5d16723abd78e5f5c4f558477c110c38844ddd8 Mon Sep 17 00:00:00 2001 From: ZabihollahNamazi Date: Sat, 28 Mar 2026 17:25:01 +0000 Subject: [PATCH 1/3] cowsay done --- implement-cowsay/cow.py | 28 ++++++++++++++++++++++++++++ implement-cowsay/requirements.txt | 1 + 2 files changed, 29 insertions(+) create mode 100644 implement-cowsay/cow.py create mode 100644 implement-cowsay/requirements.txt diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 000000000..d2279c1ae --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,28 @@ +import cowsay +import argparse + +#getting avalble animal list +animals = [a for a in dir(cowsay) if not a.startswith("__") and callable(getattr(cowsay, a))] + +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 From 87c591616ed5aaa2fb387eec663be3f881f21a32 Mon Sep 17 00:00:00 2001 From: ZabihollahNamazi Date: Wed, 1 Apr 2026 11:32:33 +0100 Subject: [PATCH 2/3] ignore the .venv --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From b39f9e0c7914f44f6f7ce32d5ef41eaca4a7743c Mon Sep 17 00:00:00 2001 From: ZabihollahNamazi Date: Sat, 6 Jun 2026 21:47:36 +0100 Subject: [PATCH 3/3] update --- implement-cowsay/cow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 implement-cowsay/cow.py diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py old mode 100644 new mode 100755 index d2279c1ae..70b5df217 --- a/implement-cowsay/cow.py +++ b/implement-cowsay/cow.py @@ -1,8 +1,9 @@ +#!/usr/bin/env python3 import cowsay import argparse #getting avalble animal list -animals = [a for a in dir(cowsay) if not a.startswith("__") and callable(getattr(cowsay, a))] +animals = cowsay.char_names parser = argparse.ArgumentParser( prog="cowsay program",