-
-
Notifications
You must be signed in to change notification settings - Fork 27
London | Elhadj Abdoul Diallo| Module-Tools | WEEK4 - Implement-cowsay #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
07d8544
b65852d
5aa1c28
0ea57af
3a55605
1371460
49ce112
b807c98
a1a8be8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
implement-cowsay/.venv. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import cowsay # type: ignore | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description="Make animals say things") | ||
parser.add_argument('--animal', choices=cowsay.char_names, help="The animal to be saying things", default="cow") | ||
|
||
parser.add_argument('message', nargs='+', help="The message to say") | ||
|
||
args = parser.parse_args() | ||
|
||
char_name = args.animal | ||
message = ' '.join(args.message) | ||
|
||
cowsay_func = getattr(cowsay, char_name) | ||
cowsay_func(message) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cowsay |
Uh oh!
There was an error while loading. Please reload this page.