Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions implement-cowsay/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import cowsay
import argparse

parser = argparse.ArgumentParser(prog="cowsay", description="displays cowsay charactor with given arguments")
parser.add_argument('--animal', choices=cowsay.char_names, default="cow", help= 'please enter a valid animal')
parser.add_argument('message', nargs="+", help= 'please enter a message')
arg = parser.parse_args()

msg = " ".join(arg.message)
animal_func = getattr(cowsay, arg.animal)
print(animal_func(msg))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: you don't need to use print here as your animal_func already prints the message. Because of the extra print you get None at the end.

1 change: 1 addition & 0 deletions implement-cowsay/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cowsay
15 changes: 0 additions & 15 deletions individual-shell-tools/ls/script-01.sh

This file was deleted.

6 changes: 0 additions & 6 deletions individual-shell-tools/ls/script-02.sh

This file was deleted.