用python绘画一些简单图片
python画笑脸
- 程序源代码
import turtle
#画脸
t = turtle.Pen()
t.speed(15)
#t.circle(150)
#t.color('orange')
t.fillcolor('yellow')
t.up()
t.begin_fill()
t.goto(0, -150)
t.circle(150)
t.down()
t.end_fill()
#画嘴
#t.coler('black')
t.pensize(3)
t.up()
t.goto(-70, -70)
t.down()
t.seth(-90)
t.circle(70, 180)
#画眉毛
#画左眉
t.pensize(2)
t.up()
t.goto(-40, 75)
t.down()
t.seth(90)
t.circle(30, 180)
#画右眉
t.pensize(2)
t.up()
t.goto(80, 75)
t.down()
t.seth(90)
t.circle(30, 180)
#画左眼睛
t.pensize(13)
t.up()
t.goto(-83, 60)
t.down()
t.circle(10)
#画右眼
t.pensize(13)
t.up()
t.goto(40, 60)
t.down()
t.circle(10)
#尝试画鼻子
t.pensize(3)
t.up()
t.goto(25, -20)
t.down()
t.seth(-180)
t.forward(60)
t.seth(60)
t.forward(50)
t.hideturtle()
turtle.mainloop()
python画五角星
-
程序源代码
import turtle t = turtle.Pen() t.shape('turtle') t.color('red') t.pensize(5) t.fillcolor('blue') t.begin_fill() for i in range(5): t.fd(100) t.left(144) t.end_fill() t.hideturtle() turtle.mainloop()
python画正方形
-
程序源代码
import turtle t=turtle.Pen() t.shape('turtle') t.fillcolor('red') t.begin_fill() for i in range(4): t.forward(120) t.left(90) t.end_fill() turtle.mainloop()python画蟒蛇
python画蟒蛇
程序源代码
import turtle t = turtle.Pen() t.shape('turtle') t.color('pink') t.up() t.fd(-250) t.pensize(15) t.down() t.seth(-40) for i in range(4): t.circle(40, 80) t.circle(-40, 80) t.left(40) t.forward(40) t.circle(20, 180) t.forward(30) turtle.mainloop()
Only you can control your future
You're not alone. You still have family,peopel who care for you and want to save you.
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步