A Few Things to Try

  • Safer picture downloading. Adapt the picture-downloading/file-renaming program to your computer by adding some safety features to make sure you never overwrite a file. A few methods you might find useful are File.exist? (pass it a filename, and it will return true or false) and exit (like if return and Napoleon had a baby—it kills your program right where it stands; this is good for spitting out an error message and then quitting).

  • Build your own playlist. For this to work, you need to have some music ripped to your computer in some format. We’ve ripped a hundred or so CDs, and we keep them in directories something like music/​genre/​artist_and_cd_name/​track_number.ogg. (I’m partial to the ogg format, though this would ...

Get Learn to Program, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.