11
Wrote my first Python script that actually did what I wanted after 8 tries
I tried to automate renaming a bunch of photo files and after 8 failed attempts it finally worked, which taught me that reading the error messages carefully is more important than just guessing what went wrong; has anyone else had a moment where a simple script took way longer than you expected?
3 comments
Log in to join the discussion
Log In3 Comments
laura_knight544d ago
Oh man, the part about reading error messages hit home hard. I spent three hours once trying to fix a script that kept crashing, and it turned out I was using a comma instead of a period in a number. The error message literally said "invalid syntax" right on that line, but I just kept guessing at what else might be wrong instead of actually looking at what the computer was trying to tell me. These days I force myself to copy the error into a text file and read it out loud before I change anything. It feels dumb, but it works way better than randomly swapping out variables and hoping for the best. Now I actually get a little excited when I see a new error, because it means the last one was fixed and I'm one step closer to something working.
6
diana_park4d ago
Reading errors out loud is solid advice, @laura_knight54, saved me from a three-hour headache chasing a missing parenthesis last week.
2
janaf764d agoOG Member
Ha! Yeah but reading it out loud won't save you if you're misreading what it says.
1