> 文档中心 > python turtle绘制鲁迅300多行源码

python turtle绘制鲁迅300多行源码

真实效果
在这里插入图片描述
部分源码
import turtle as t

移动画笔不显示轨迹

def goto(x, y):
t.penup()
t.goto(x, y)
t.pendown()

绘制头发

def hair_draw():
t.begin_fill()
goto(-180, 110)
t.setheading(-200)
t.pencolor(“#55423C”)
t.fd(35)
t.setheading(-90)
t.color(“#3C2A27”)
t.width(4)
t.circle(220, -180)
t.left(110)
t.width(1)
t.fd(35)
t.right(74)
t.width(4)
t.fd(170)
t.setheading(184)
t.fd(90)
t.right(8)
t.fd(90)
t.goto(-180, 110)
t.color(“#574440”)
t.end_fill()

脸部绘制

def face_draw():
t.begin_fill()
t.width(6)
t.color(“#EEC1BD”)
goto(190, 110)
t.setheading(122)
t.fd(170)
t.setheading(184)
t.fd(90)
t.right(8)
t.fd(90)
t.goto(-180, 110)
t.left(105)
t.circle(180, 82)
t.right(5)
t.circle(180, 82)
t.color(“#FBE7E0”)
t.end_fill()

goto(-10, 140)t.color("#5C4942")t.setheading(170)for i in range(5, 10, 2):    t.width(i)    t.fd(20)goto(-20, 115)t.left(10)t.width(6)t.fd(46)goto(30, 140)t.left(190)for i in range(5, 10, 2):    t.width(i)    t.fd(20)goto(40, 115)t.right(10)t.width(6)t.fd(46)t.begin_fill()t.width(2)goto(-50, 60)t.left(33)t.circle(-108, 70)t.left(206)t.circle(360, 20)goto(-50, 60)t.end_fill()t.color("#FABCAD")t.width(6)goto(0, 97)t.right(145)t.fd(12)t.right(90)t.fd(12)t.width(6)goto(-10, 37)t.left(57)t.fd(35)t.begin_fill()goto(-100, 55)t.circle(30)t.end_fill()t.begin_fill()goto(125, 52)t.circle(30)t.end_fill()

耳朵绘制

def ear_draw():
t.begin_fill()
goto(-180, 110)
t.setheading(-200)
t.fd(35)
t.left(5)
t.circle(30, 130)
t.circle(71, 86)
t.color(“#F9E8E1”)
goto(-184, 110)
goto(-180, 110)
t.end_fill()

t.color("#F2C4B5")goto(-230, 95)t.right(20)t.circle(-90, 30)goto(-215, 90)t.right(20)t.fd(20)t.begin_fill()goto(193, 110)t.left(70)t.fd(35)t.right(5)t.circle(-30, 130)t.circle(-78, 86)t.color("#F9E8E1")goto(194, 110)goto(191, 110)t.end_fill()t.color("#F2C4B5")goto(190, 80)t.left(50)t.circle(90, -30)goto(220, 90)t.left(45)t.fd(30)

颈部绘制

def neck_draw():
t.begin_fill()
t.width(4)
t.color(“#151A26”)
t.setheading(-20)
goto(-75, -27)
t.fd(60)
t.right(20)
t.fd(20)
t.right(5)
t.fd(10)
t.left(90)
t.fd(10)
t.right(5)
t.fd(20)
t.right(20)
t.fd(60)
t.color(“#F4C6BB”)
t.right(5)
t.width(2)
t.circle(300, -30)
t.goto(-75, -27)
t.color(“#FBE9DC”)
t.end_fill()

t.begin_fill()t.width(4)t.color("#EDEEDC")goto(-75, -32)t.setheading(-20)t.fd(60)t.right(20)t.fd(20)t.right(5)t.fd(10)t.left(90)t.fd(10)t.right(5)t.fd(20)t.right(20)t.fd(60)t.setheading(-90)t.color("#171D2D")t.fd(30)t.left(135)t.circle(110, -90)t.goto(-75, -32)t.color("#333949")t.end_fill()goto(-20, -93)t.color("#171D2D")t.setheading(0)t.width(8)t.fd(50)

身体绘制

def body_draw():
# 左手
t.begin_fill()
t.width(4)
t.color(“#19182B”)
goto(-75, -60)
t.setheading(-155)
t.circle(250, 50)
t.circle(120, 70)
t.left(95)
t.circle(-260, 20)
t.left(95)
t.fd(40)
t.right(90)
t.fd(35)
t.goto(7, -95)
t.setheading(180)
t.fd(30)
t.right(90)
t.fd(3)
t.goto(-75, -60)
t.color(“#363D4D”)
t.end_fill()

t.begin_fill()t.color("#171E2B")goto(-160, -348)t.right(32)t.circle(-250, 20)t.right(158)t.circle(-250, 20)t.goto(-160, -348)t.end_fill()

百度网盘获取完整代码:
链接:https://pan.baidu.com/s/1HLODJF5wMfYqhdfmKkGQsw?pwd=pqgj
提取码:pqgj

python turtle绘制鲁迅300多行源码 创作打卡挑战赛 python turtle绘制鲁迅300多行源码 赢取流量/现金/CSDN周边激励大奖