spgl.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:SPGL 作者: wynand1004 项目源码 文件源码
def __init__(self,
                shape,
                color,
                x = 0,
                y = 0):

        turtle.Turtle.__init__(self)
        # self.hideturtle()
        self.penup()
        # Register shape if it is a .gif file
        if shape.endswith(".gif"):
            try:
                turtle.register_shape(shape)
            except:
                Game.logs.append("Warning: {} file missing from disk.".format(shape))

                # Set placeholder shape
                shape = "square"

        self.shape(shape)
        self.color(color)
        self.goto(x, y)

        #Set click binding
        self.onclick(self.click)

        # Append to master button list
        Game.buttons.append(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号