XKCD
XKCD copied to clipboard
Added function to print comic information to STDOUT
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.
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.
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.
Maybe at least print the comic number no matter what? That would make issues like #8 reproducible.
This is great for your first time with Python btw! The only stuff I wrote back then was garbage
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!