Skip to content
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

Added function to print comic information to STDOUT #12

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

taylor85345
Copy link

I thought it would be nice to have comic information (Title, Publish Date, Number, and Alt Text) written to the terminal output. Sorry if there's a better way to do this, it's the first time I've ever touched Python code.

Copy link
Contributor

@TheTechRobo TheTechRobo left a comment

Choose a reason for hiding this comment

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

Might be cool to offer it as an option to forgo the popup i.e. just get that metadata.

xkcd.py Outdated Show resolved Hide resolved
Copy link
Author

@taylor85345 taylor85345 left a comment

Choose a reason for hiding this comment

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

Updated to ISO date format

@taylor85345
Copy link
Author

taylor85345 commented Jan 13, 2022

Might be cool to offer it as an option to forgo the popup i.e. just get that metadata.

I tried to make the data optional, but again it's my first time touching python and I didn't have any luck adding the necessary flag

EDIT: Also, would foregoing the pop-up make sense in combination with the --random flag? I feel like a random comic would be the most important place to have at least the comic number printed.

@taylor85345
Copy link
Author

taylor85345 commented Jan 13, 2022

Ok, I figured it out. I've added the flags --metadata to trigger printing metadata to STDOUT, and --noimage to optionally suppress display of the comic.

@TheTechRobo
Copy link
Contributor

Maybe at least print the comic number no matter what? That would make issues like #8 reproducible.

@TheTechRobo
Copy link
Contributor

This is great for your first time with Python btw! The only stuff I wrote back then was garbage

@taylor85345
Copy link
Author

taylor85345 commented Jan 14, 2022

Done!

And Thanks. I'm reasonably competent with bash script, so I've got the basic scripting logic, and it's mostly just extrapolating from what's already there to get the syntax. I appreciate the feedback!

Copy link
Contributor

@TheTechRobo TheTechRobo left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants