omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Error message for a comment?

    Pythonista
    2
    3
    1965
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • heyguy4
      heyguy4 last edited by

      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)```
      1 Reply Last reply Reply Quote 0
      • Webmaster4o
        Webmaster4o last edited by

        @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

        1 Reply Last reply Reply Quote 0
        • heyguy4
          heyguy4 last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors