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