There was an error while loading. Please reload this page.
1 parent 3f26722 commit 47c12adCopy full SHA for 47c12ad
2 files changed
implement-cowsay/cow.py
@@ -0,0 +1,32 @@
1
+
2
+import argparse
3
+import cowsay
4
5
+def main():
6
+ parser = argparse.ArgumentParser(
7
+ prog="cowsay",
8
+ description="Make animals say things"
9
+ )
10
11
+ parser.add_argument(
12
+ "--animal",
13
+ choices=cowsay.char_names,
14
+ default="cow",
15
+ help="The animal to be saying things."
16
17
18
19
+ "message",
20
+ nargs="+",
21
+ help="The message to say."
22
23
24
+ args = parser.parse_args()
25
26
+ message = " ".join(args.message)
27
28
+ print(cowsay.get_output_string(args.animal, message))
29
30
31
+if __name__ == "__main__":
32
+ main()
implement-cowsay/requirements.txt
@@ -0,0 +1,2 @@
+cowsay
+argparse
0 commit comments