Forum Archive

Error message for a comment?

heyguy4

Why is line 19 from my code a syntax error, when it is just 3 apostrophes at the bottom of a comment.
Here's my code BTW. It's an unfinished program so it shouldn't really do anything, but I don't know why there is an error.
```

coding: utf-8

from scene import *
import photos
import sound
import ui
import random
import math
A = Action

class MyScene (Scene):
def setup(self):
self.background_color = 'green'

            self.spriteName = LabelNode('h', font=('Helvetica', 20)
            '''
            self.spriteName.color = (0, 0, 1)

            '''

            self.spriteName.anchor_point = (5,5)
            self.spriteName.position = (50, 50)
            '''
            self.spriteName.texture = self.texture('plc:Gem_Blue')
            '''


    def did_change_size(self):
            pass



    def update(self):


    def touch_began(self, touch):
            pass

    def touch_moved(self, touch):
            pass

    def touch_ended(self, touch):
            pass

if name == 'main':
run(MyScene(), show_fps=False)```

Webmaster4o

@heyguy4 said:

self.spriteName = LabelNode('h', font=('Helvetica', 20)

You're missing a closing parenthesis on the line
self.spriteName = LabelNode('h', font=('Helvetica', 20)
The SyntaxError occurs only there because that's where the lack of a closing parenthesis actually becomes problematic for the parser.

FYI, this kind of question has nothing to do with specifically Pythonista, and is therefore a much better fit for something like https://stackoverflow.com

heyguy4

I was confused because the compiler said the error was at line 19 which didn't contain an error, therefore I thought it was an issue with Pythonista's compiler. But thank you for responding. It works now.