14
Spent 2 hours debugging a missing semicolon in my Python script last night
I was sitting in my living room at 11pm staring at a 500-line loop that kept throwing a syntax error, and after retracing every indent and variable name, I finally noticed I forgot a semicolon on line 47 when I copied a snippet from an old forum post - has anyone else wasted a whole evening on something that tiny?
2 comments
Log in to join the discussion
Log In2 Comments
hugo_nelson21d ago
Wait, you have a 500-line loop in Python? That sounds rough, why not break it into smaller functions, like a helper for that copied snippet part? Also, are you actually using semicolons in Python, or did you mean you copy/pasted from a language that needs them, like JavaScript or PHP? Because a missing semicolon in Python shouldn't cause a syntax error unless you were trying to put multiple statements on one line. Just trying to figure out what you really ran into there.
1
cameronb5221d ago
Yeah, I've definitely copy-pasted PHP code into Python and spent way too long figuring out where the semicolons went.
2