Python Turtle库绘制小黄脸表情包
下面只有一个表情的代码
#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__: "TC"
import turtle
turtle.setup(500, 600)
turtle.pencolor("#B26A0F")
turtle.begin_fill()
turtle.circle(100)
turtle.fillcolor("#F9E549")
turtle.end_fill()
turtle.home()
turtle.penup()
turtle.goto(-10, 100)
turtle.pendown()
turtle.pensize(2)
turtle.setheading(90)
turtle.color("sienna")
turtle.circle(20,180)
turtle.penup()
turtle.goto(50, 100)
turtle.pendown()
turtle.setheading(90)
turtle.color("sienna")
turtle.circle(20,180)
turtle.penup()
turtle.goto(55, 80)
turtle.pendown()
turtle.pensize(2)
turtle.setheading(-90)
turtle.begin_fill()
turtle.pencolor("sienna")
turtle.circle(-55,180)
turtle.setheading(0)
turtle.forward(110)
turtle.fillcolor('sienna')
turtle.end_fill()
turtle.goto(55, 80)
turtle.pendown()
turtle.pensize(2)
turtle.setheading(-90)
turtle.begin_fill()
turtle.pencolor("sienna")
turtle.circle(-55,10)
turtle.setheading(180)
turtle.forward(108)
turtle.setheading(90)
turtle.circle(55,10)
turtle.setheading(0)
turtle.forward(110)
turtle.fillcolor('white')
turtle.end_fill()
#m帽子
turtle.penup()
turtle.pencolor('silver')
turtle.goto(-100, 150)
turtle.pensize(1)
turtle.pendown()
turtle.setheading(-120)
turtle.forward(10)
turtle.left(1)
turtle.setheading(-100)
turtle.circle(40,10)
turtle.forward(60)
turtle.right(1)
turtle.circle(-60,10)
turtle.forward(30)
turtle.right(5)
turtle.circle(30,90)
turtle.forward(20)
turtle.right(3)
turtle.circle(20,10)
turtle.forward(50)
turtle.circle(10,20)
turtle.setheading(10)
turtle.circle(40,30)
turtle.right(2)
turtle.forward(10)
turtle.setheading(5)
turtle.forward(30)
turtle.circle(50,30)
turtle.setheading(4)
turtle.forward(30)
turtle.circle(700,10)###
turtle.circle(20,100)
turtle.setheading(143)
turtle.forward(170)
turtle.setheading(130)
turtle.forward(20)
turtle.circle(90,50)
turtle.forward(20)
turtle.pencolor('white')
turtle.setheading(180)
turtle.circle(90,70)
turtle.begin_fill()
turtle.fillcolor('white')
turtle.forward(20)
turtle.setheading(-5)
turtle.circle(90,30)
turtle.setheading(10)
turtle.circle(-80,30)
turtle.forward(10)
turtle.setheading(1)
turtle.circle(400,10)
turtle.setheading(-45)
turtle.pencolor('snow2')
turtle.circle(1000,10)
turtle.setheading(2.5)
turtle.forward(2)
turtle.pencolor('silver')
turtle.circle(30,5)###
turtle.circle(35,100)
turtle.setheading(145)
turtle.forward(170)
turtle.setheading(130)
turtle.forward(20)
turtle.circle(90,50)
turtle.forward(20)
turtle.setheading(180)
turtle.circle(90,70)
turtle.forward(15)
turtle.end_fill()
turtle.penup()
turtle.goto(-101, 150)
turtle.color("Black")
turtle.pendown()
turtle.pensize(10)
turtle.setheading(0)
turtle.circle(2000,3)
turtle.right(2)
turtle.circle(2011,3)
turtle.hideturtle()
turtle. Done()