Unexpected token - Python

I am beginner on python for grasshopper and have come across the following error :

  1. Runtime error (SyntaxErrorException): unexpected token ‘pt1’

  2. File “”, line 21
    pt1 += n1*0.2


SyntaxError: unexpected token ‘pt1’

paneling with python - unexpected token.gh (8.3 KB)

looking forward to understand how to resolve “Unexpected token error”


You had an extra ‘(’ on line 19.

It should read:

n5 = surf.NormalAt((u+0.6)/uDiv, (v+0.5)/vDiv)

1 Like

thanks Chuck, it worked.
now its showing

Runtime error (MissingMemberException): ‘list’ object has no attribute ‘PointAt’
line 9, in script

Hi can you paste your script enclosed in backticks?

paneling with python - unexpected token.gh (8.1 KB)

Like this
import this
print this.s

To produce

import this
print this.s
1 Like

Great! For that error, right click the first input on the python component and change list access to item access. Am away from my computer but can take some screenshots if there’s an issue.

You’re trying to access the value correctly, but python is treating it as a list with one item.


That’s great…
Thanks a lot for your explanation. Although it’s very basic, you explained it well with patience. Appreciated