Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions implement-cowsay/animalsay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import cowsay
import argparse

# cowsay.cow(" ".join(sys.argv[1:]))

# cowsay.turtle(" ".join(sys.argv[1:]))

# cowsay.fish(" ".join(sys.argv[1:]))

parser = argparse.ArgumentParser(
prog = "cowsay shell command",
description = "cowsay shell command on python Make animals say things"
)
animals = ["beavis","cheese","cow","daemon","dragon","fox","ghostbusters","kitty","meow","miki","milk","octopus","pig","stegosaurus","stimpy","trex","turkey","turtle","tux"]
parser.add_argument("--animal", choices=animals, default = "cow", help="The animal to be saying things.")
parser.add_argument("message", nargs="+", help="The message to say.")

args = parser.parse_args()

cowsay_function = getattr(cowsay, args.animal)
cowsay_function(" ".join(args.message))

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cowsay
Loading