import turtle
size = 10
line = 40
# 拿出笔
pen = turtle.Pen()
pen.pensize(size)
pen.pencolor("blue")
turtle.tracer(False) # 不跟踪动画
pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()
pen.left(90)
pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()
pen.left(90)
pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()
pen.left(90)
pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()
pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()
pen.left(90)
pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()
pen.left(90)
pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()
pen.hideturtle() #隐藏
turtle.tracer(True) # 回复效果
turtle.done() #结束