29
My first Python script crashed for 2 hours because of a single typo
I finally decided to learn Python last month and was feeling pretty good about myself after finishing a few tutorials. So I tried to write a simple script that would rename a bunch of files in a folder. It kept throwing errors and I had no idea why. I spent like 2 hours staring at the code, checking every line. Turns out I wrote 'def' instead of 'def' in one place - no wait, I wrote 'ddef' as the function name. It was such a dumb mistake. I almost gave up but then I googled the error message and found a forum post that pointed it out. Has anyone else spent way too long on a typo that should have taken 2 minutes to spot?
2 comments
Log in to join the discussion
Log In2 Comments
cooper.reese1d ago
Dude I once spent an hour debugging a missing colon.
5
hugo_moore1d ago
Did you at least learn to triple check your spelling before hitting run like I did after that same mistake?
2