Skip to content

Commit ca1feba

Browse files
committed
cowsay done
1 parent 99c380e commit ca1feba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

implement-cowsay/cow.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
import cowsay
3+
import argparse
4+
5+
animals = cowsay.char_names
6+
parser = argparse.ArgumentParser(prog="cowsay", description="Make animals say things")
7+
parser.add_argument('message', nargs='+')
8+
parser.add_argument('--animal', choices=animals, default='cow')
9+
10+
args = parser.parse_args()
11+
msg_text = ' '.join(args.message)
12+
print(cowsay.get_output_string(args.animal, msg_text))

0 commit comments

Comments
 (0)