diff --git a/implement-cowsay/.gitignore b/implement-cowsay/.gitignore new file mode 100644 index 000000000..2a585e0cd --- /dev/null +++ b/implement-cowsay/.gitignore @@ -0,0 +1,3 @@ +.venv/ +__pycache__/ +*.pyc \ No newline at end of file diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 000000000..be4f4d0c2 --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,26 @@ +import argparse +import cowsay + +parser = argparse.ArgumentParser( + prog="cowsay", + description="Make an animal say something" +) + +parser.add_argument( + "message", + nargs="+", + help="What do you want the animal to say?" +) + +parser.add_argument( + "--animal", + choices=cowsay.char_names, + default="cow", + help="Choose an animal" +) + +args = parser.parse_args() + +message = " ".join(args.message) + +print(cowsay.get_output_string(args.animal, message)) \ No newline at end of file diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 000000000..37fef9e1c --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay==6.1 \ No newline at end of file