python图章作画之彩树
3月 21, 2021
0 Comments


import turtle turtle.shape('triangle') # 设定造型为三角形 turtle.left(90) # 左转90度 turtle.bk(150) turtle.shapesize(11) turtle.color('green') # 设定颜色为绿色 turtle.stamp() turtle.fd(50) turtle.shapesize(9) turtle.color('yellow') # 设定颜色为绿色 turtle.stamp() turtle.fd(50) turtle.shapesize(7) turtle.color('orange') # 设定颜色为绿色 turtle.stamp() turtle.fd(50) turtle.shapesize(5) turtle.color('red') # 设定颜色为绿色 turtle.stamp() turtle.fd(50) turtle.color('brown') # 设定颜色为棕色 turtle.pensize(10) # 设定画笔线宽为10 turtle.penup() # 抬笔 turtle.bk(265) # 倒退265 turtle.ht() # 隐藏 turtle.pendown() # 落笔 turtle.bk(100) turtle.done() # 事件循环,一定要在程序最后一行标签:python stamp art, python stamp graphics