Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

London | Elhadj Abdoul Diallo| Module-Tools | WEEK4 - Implement-cowsay #39

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
implement-cowsay/.venv.
14 changes: 14 additions & 0 deletions implement-cowsay/cow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import cowsay
import argparse

parser = argparse.ArgumentParser(description="Make animals say things")
parser.add_argument("--animal", choices=cowsay.char_names, help="The animal to be saying things", default="cow")
parser.add_argument("message", nargs="+", help="The message to say")

args = parser.parse_args()

char_name = args.animal
message = " ".join(args.message)

cowsay_func = getattr(cowsay, char_name)
cowsay_func(message)
1 change: 1 addition & 0 deletions implement-cowsay/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cowsay