diff --git a/implement-cowsay/.gitignore b/implement-cowsay/.gitignore new file mode 100644 index 000000000..21d0b898f --- /dev/null +++ b/implement-cowsay/.gitignore @@ -0,0 +1 @@ +.venv/ diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 000000000..a07142cbd --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,30 @@ +import cowsay +import argparse + +parser = argparse.ArgumentParser( + prog="cowsay", + description="Make animals say things", +) + +parser.add_argument( + "message", + nargs="+", + help="The message to say.", +) + +parser.add_argument( + "--animal", + choices = cowsay.char_names, + default="cow", + help="The animal to be saying things.", +) + +args = parser.parse_args() +message = " ".join(args.message) + +animal_function = getattr(cowsay, args.animal) + +animal_function(message) + +# print(message) +# print(args.animal) \ No newline at end of file diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 000000000..cc5571034 --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay \ No newline at end of file