First of all I'd like to say that I'm new to python, and new to mailinglists.
So if I make any mistakes, please correct me.
Now, onto my issue: I am trying to put an "else:" statement inside a class:
class Line(): #The class
def __init__( self, start_dot, end_dot, width): #init function
self.start_dot = start_dot
self.surface = pygame.Surface((w, h), SRCALPHA)
self.surface.fill((0,0,0,0))
self.end_dot = end_dot
self.width = width
self.selected = 0
self.tempX1 = start_dot.x
self.tempY1 = start_dot.y
self.tempX2 = end_dot.x
self.tempY2 = end_dot.y
self.visibleTemp1 = self.start_dot.visible
self.visibleTemp2 = self.end_dot.visible
self.draw = 0
self.lastWasMove = 0
self.Draw(1)
self.rico = 0
def Draw ( self, typeOf ): #draw function
if ((self.start_dot.x > self.end_dot.x) and (self.start_dot.y !=
self.end_dot.y)):
self.rico = (self.start_dot.x - self.end_dot.x /
abs(self.start_dot.y - self.end_dot.y)
else: #<-causes error message
if ((self.start_dot.x < self.end_dot.x and self.start_dot.y !=
self.end_dot.y))
self.rico = (self.end_dot.x - self.start_dot.x) /
abs(self.start_dot.y - self.end_dot.y)
else:
self.rico = 0
the first "else" statement in the Draw() function triggers a syntax error.
Could anyone please enlighten me why this is happening?
Thanks in advance!
Stijn
_________________________________________________________________
25GB gratis online harde schijf
http://skydrive.live.com
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor