问题
I have no idea how to fix this error.
Maybe there's an open parenthesis or quotation mark somewhere before this line?
What is wrong with this code?
Class Ribbon: # I got an error on this line!
def __init__(self, xpos, ypos, m, g):
self.x=xpos
self.y=ypos
self.mass=m
self.gravity=g
..
def update(self, xpos, ypos):
..
def display(self, xpos, ypos):
..
回答1:
Here is your problem:
Class Ribbon (object):
def __init__(self, xpos, ypos, m, g):
self.x=xpos
self.y=ypos
self.mass=m
self.gravity=g
also remember that other def must be indented properly as well
来源:https://stackoverflow.com/questions/53531121/processing-py-unknown-error-on-class-definition