Skip to content

Commit 9914ae4

Browse files
committed
done cow.py
1 parent 896a7ff commit 9914ae4

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

implement-cowsay/cow.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import cowsay
2+
import sys
3+
import argparse
4+
import os
5+
6+
list_of_choices = cowsay.char_names
7+
8+
9+
parser = argparse.ArgumentParser(
10+
prog="cowsay",
11+
description="Make animals say things",
12+
)
13+
14+
parser.add_argument("--animal", nargs="?",default="cow", help="The animal to be saying things.", choices=list_of_choices)
15+
parser.add_argument("message", nargs="*", default="", help="message to say")
16+
17+
args = parser.parse_args()
18+
19+
print(cowsay.get_output_string(str(args.animal)," ".join(args.message)))

implement-cowsay/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cowsay

0 commit comments

Comments
 (0)