Skip to content

Conversation

Luke-Manyamazi
Copy link

@Luke-Manyamazi Luke-Manyamazi commented Aug 14, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

  • Added cow.py command-line tool using the cowsay library.
  • Implemented --animal option with dynamic choices from cowsay.char_names.
  • Displayed messages in the selected animal’s ASCII art speech bubble.
  • Provided --help output showing available animals.
  • Added error handling for invalid animal choices.

Questions

  1. Would it be better to call cowsay.cowsay(message, cow=animal) for all animals instead of getattr(cowsay, animal)(message) to keep output formatting consistent across animals?

@Luke-Manyamazi Luke-Manyamazi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 14, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Aug 19, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

As cowsay includes a package outwith the normal python installation, you should include it as a requirement. Can you find how to do this?

For your question, whether you use getattr or call a function directly will depend largely on the library you are using. In this case, if cowsay has a convenience function that takes an animal argument. you could use that and it should function largely the same.

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 19, 2025
@Luke-Manyamazi
Copy link
Author

As cowsay includes a package outwith the normal python installation, you should include it as a requirement. Can you find how to do this?

For your question, whether you use getattr or call a function directly will depend largely on the library you are using. In this case, if cowsay has a convenience function that takes an animal argument. you could use that and it should function largely the same.

I have installed the requirements.txt file and added cowsay as a requirement for the program.

@Luke-Manyamazi Luke-Manyamazi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants