[Pythonmac-SIG] newbie question (bullet symbol?)

Just van Rossum just@letterror.com
Thu, 10 Sep 1998 15:14:10 +0200


At 11:21 PM -0800 9/9/98, Bob Savage wrote:
>Hi, all,
>
>just learning to work with this stuff. I was toying with some code out of
>the Mark Lutz book and trying to customize it a bit. I entered it into a
>new script in the IDE and tried to run it but I got a syntax error warning
>and the error indicated it was a problem in the middle of a word! In the
>error message dialog box it makes it look like there is a bullet symbol in
>the middle of the word so I thought I must have mistyped something. I
>selected several letters before and after the phantom bullet and tried
>typing over it, but it was still there when I tried to run it again. I
>tried to see if there was an extra character there by moving the cursor
>with the arrow keys and it doesn't seem to be there. Then I tried just
>dragging the script onto the regular Python application and it gave me a
>syntax error with a something like a little carot (exponent) symbol under
>the exact same place.

The IDE uses the same info for the syntax error dialog, but the interactive
interpreter will normally point at a character, whereas the bullet will be
before that character. Not quite the same, but it was the best (ie. easiest
;-) solution I could come up with at the time.

>If I remember correctly (the script is at work) the
>error seems to be inside the variable name:
>counter
>right after the e (before the r). Oddly enough an earlier line:
>counter = 0
>worked fine. Later I was doing
>counter = counter + 1
>and the syntax error occurred in the first use of counter on that line.
>
>(?)

Sometimes the syntax error position is misleading. Eg. this:

x = (a, b, c
counter = 12

will give an syntax error on counte*r.

I'm afraid it's really impossible to guess what exactly your problem was
without seeing the script.

Good luck,

Just