def turtlewrite(self, text, move=False): if isinstance(text, list): text = ' '.join(map(str, text)) else: text = str(text) add_command(self.pen.write, text, move) add_command(get_canvas().update)
def backward(self, v): add_command(self.pen.backward, v).add_command(get_canvas().update)
def setheading(self, v): add_command(self.pen.setheading, v)
def clear(self): self.home() add_command(self.pen.clear) add_command(get_canvas().update)
def endfill(self): add_command(self.pen.fill, 0) add_command(get_canvas().update)
def setx(self, x): t = self.pen add_command(t.goto, x, t.position()[1]) add_command(get_canvas().update)
def pencolor(self, *args): add_command(self.pen.color, *args)
def delay(self, x): add_command(self.pen.delay,x)
def home(self): add_command(self.pen.setheading, 0) add_command(self.pen.goto, 0, 0) add_command(get_canvas().update)
def setxy(self, x, y): add_command(self.pen.goto, x, y) add_command(get_canvas().update) add_command(get_scroller().resizescrollregion)
def sety(self, y): t = self.pen add_command(t.goto, t.position()[0], y) add_command(get_canvas().update)
def endfill(self): add_command(self.pen.fill, 0) add_command(get_canvas().update) add_command(get_scroller().resizescrollregion)
def backward(self, v): add_command(self.pen.backward,v) add_command(get_canvas().update) add_command(get_scroller().resizescrollregion)
def clear(self): self.home() add_command(self.pen.clear) add_command(get_canvas().update) add_command(get_scroller().resizescrollregion)
def right(self, v): add_command(self.pen.right, v)
def pendown(self): add_command(self.pen.down)
def forward(self, v): add_command(self.pen.forward, v) add_command(get_canvas().update)
def showturtle(self): add_command(self.pen.tracer, 1)
def home(self): add_command(self.pen.setheading, 0) add_command(self.pen.goto, 0, 0) add_command(get_canvas().update) add_command(get_scroller().resizescrollregion)
def left(self, v): add_command(self.pen.left, v)
def setxy(self, x, y): add_command(self.pen.goto, x, y) add_command(get_canvas().update)
def penup(self): add_command(self.pen.up)
def penwidth(self, v): add_command(self.pen.width, v)
def hideturtle(self): add_command(self.pen.tracer, 0)
def startfill(self): add_command(self.pen.fill, 1)
def speed(self, x): add_command(self.pen.speed,x)
def setx(self, x): add_command(self.pen.setx,x) add_command(get_canvas().update) add_command(get_scroller().resizescrollregion)