Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 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
12 changes: 12 additions & 0 deletions implement-cowsay/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import cowsay
import argparse
import sys


parser = argparse.ArgumentParser(description="displays cowsay charactor with given arguments")
parser.add_argument('animal', type=str, choices=cowsay.char_names, default="cow", help= 'please enter a valid animal')
parser.add_argument('message', type=str, help= 'please enter a message')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you please try to run the commands exactly as described in readme? For example, that's what I see (I replaced cow.py with main.py to match your naming):

python3 main.py Grass, delicious.
usage: main.py [-h] {beavis,cheese,cow,daemon,dragon,fox,ghostbusters,kitty,meow,miki,milk,octopus,pig,stegosaurus,stimpy,trex,turkey,turtle,tux} message
main.py: error: argument animal: invalid choice: 'Grass,' (choose from 'beavis', 'cheese', 'cow', 'daemon', 'dragon', 'fox', 'ghostbusters', 'kitty', 'meow', 'miki', 'milk', 'octopus', 'pig', 'stegosaurus', 'stimpy', 'trex', 'turkey', 'turtle', 'tux')

You may want to check nargs for the message arg :) https://docs.python.org/3/library/argparse.html#nargs

You can also check on positional arguments : https://docs.python.org/3/library/argparse.html (animal should be specified via --animal)

Let me know if you have any questions!

arg = parser.parse_args()

animal_func = getattr(cowsay, arg.animal)
print(animal_func(arg.message))
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.