We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4350f48 commit b5d1672Copy full SHA for b5d1672
implement-cowsay/cow.py
@@ -0,0 +1,28 @@
1
+import cowsay
2
+import argparse
3
+
4
+#getting avalble animal list
5
+animals = [a for a in dir(cowsay) if not a.startswith("__") and callable(getattr(cowsay, a))]
6
7
+parser = argparse.ArgumentParser(
8
+ prog="cowsay program",
9
+ description="Make animals say things"
10
+)
11
12
+parser.add_argument(
13
+ "--animal",
14
+ default="cow",
15
+ choices=animals,
16
+ help=f"The animal to be saying things (choose from: {', '.join(animals)})"
17
18
19
+ "message",
20
+ nargs="+",
21
+ help="message to show")
22
23
+args = parser.parse_args()
24
25
+text = " ".join(args.message)
26
+animal = args.animal
27
28
+getattr(cowsay, animal)(text)
implement-cowsay/requirements.txt
@@ -0,0 +1 @@
+cowsay
0 commit comments