Skip to content

Conversation

Pezhman-Azizi
Copy link

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

This PR adds a Python command-line tool (cow.py) that replicates the classic cowsay functionality using the cowsay library.

Why

To provide a fun but practical example of wrapping a Python library into a CLI tool, with proper argument parsing and dynamic options.

How

Added argparse support for user input.

Accepts a message (positional argument) and an optional --animal flag.

Dynamically fetches supported animals from cowsay.char_names (no hardcoding).

Defaults to the cow character if no animal is specified.

Outputs ASCII art with the text “spoken” by the chosen animal.

Includes built-in --help with clear usage instructions.

Testing

Run python3 cow.py "Hello world!" → cow output.

Run python3 cow.py --animal turtle "Fish are cool!" → turtle output.

Run python3 cow.py --help → displays usage and available animals.

Questions

@Pezhman-Azizi Pezhman-Azizi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 21, 2025
@LonMcGregor
Copy link

This implementation looks good to me

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and all review comments have been addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants