Python 使用_init时出现语法错误__

Python 使用_init时出现语法错误__,python,Python,如果答案很明显,我很抱歉,但是出于某种原因,下面的代码在def u_; init _;块之后的每一行都给了我一个语法错误。 但是,如果我只是注释掉init,那么整个程序运行良好 import graphics from graphics import * class Block: def __init__(self,x,y,win,fid,length,orien,colour): wind = win if (orien == "horizont

如果答案很明显,我很抱歉,但是出于某种原因,下面的代码在def u_; init _;块之后的每一行都给了我一个语法错误。 但是,如果我只是注释掉init,那么整个程序运行良好

import graphics
from graphics import *


class Block:

    def __init__(self,x,y,win,fid,length,orien,colour):

        wind = win
        if (orien == "horizontal"):

            topL,dump = getPoint(fid)

            lightRect = Rectangle(getPoint(fid)


  #      else:
   #         x =5



    def draw(self):
        return        


    def undraw(self):
        return


    def highlight(self):
        return


    def unhighlight(self):
        return


    def switchHighlight(self):
        return

    def move(self,target):
        return
任何帮助都将不胜感激

中缺少“)”:

在:


类块:
应该是
类块():
并跟踪缩进。当然,正如mchfrnc所提到的,语法错误。
类块:
应该是
类块():
,并跟踪缩进。它需要一致的4个空格。当然,正如mchfrnc提到的,语法错误。谢谢!我想这可能太明显了。。。谢谢!我想这可能太明显了。。。DX
lightRect = Rectangle(getPoint(fid)