Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Odd Syntax Errors
#1
So I updated some code I've been using for a while. I went to test the new code and got the following syntax error:

Output:
File "minilog.py", line 379 fields = [ for arguments in argument] ^ SyntaxError: invalid syntax
No problem. I stopped working on that line halfway through because I thought of a better way to do it. So I deleted that line and ran it again. I got this syntax error:

Output:
File "minilog.py", line 111 aliases = {'<': 'previous', '>': 'next', 'g': 'goto', 'q': 'quit', 'r': 'rows' 't': 'text', 'v': 'view'} ^ SyntaxError: invalid syntax
Okay, I forgot a comma when adding an item to a dictionary. I do that all the time. I fixed it and ran it, and everything worked fine. But then it hit me. The first error is on line 379, but the second error is before that on line 111. Python checks syntax back to front?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Odd Syntax Errors - by ichabod801 - Oct-27-2019, 08:38 PM
RE: Odd Syntax Errors - by Gribouillis - Oct-27-2019, 08:57 PM
RE: Odd Syntax Errors - by buran - Oct-28-2019, 08:41 AM
RE: Odd Syntax Errors - by ichabod801 - Oct-28-2019, 12:34 PM
RE: Odd Syntax Errors - by ichabod801 - Oct-28-2019, 02:12 PM
RE: Odd Syntax Errors - by Gribouillis - Oct-28-2019, 02:42 PM
RE: Odd Syntax Errors - by ichabod801 - Oct-28-2019, 03:02 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020