程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

2023-06(4)

当一个学了20分钟python turtle 的人画滑稽会怎样

发布于2019-08-05 18:37     阅读(1557)     评论(0)     点赞(0)     收藏(0)


 

python 3.7 

链接:https://pan.baidu.com/s/1Lob447oqCgD6nb39sB9cig 
提取码:vn0a 
 

pycharm

链接:https://pan.baidu.com/s/1BndDvTG1hPnBmq5leu3gDQ 
提取码:3jus 
 

#huaji
import turtle as t
#-------------脸
t.setup(960,959,0,0)
t.color("orange")
t.pensize("25")
t.penup()
t.goto(-300,0)
t.pendown()
t.left(90)
t.fillcolor("yellow")
t.begin_fill ()
t.circle(-300)
t.end_fill ()


#-----------嘴-----------
t.penup()
t.goto(-220,-10)
t.seth(90)
for i in range(90):
    t.pensize(4+0.15*i)
    t.color("brown")
    t.pendown()
    t.circle(-220,-1)
for i in range(90):
    t.pensize(17.5-0.15*i)
    t.color("brown")
    t.pendown()
    t.circle(-220,-1)


 #------------左眼---------------   
t.penup()
t.goto(-80,150)
t.color("orange")
t.pensize("25")
t.seth(90)
t.pendown()
t.left(50)
t.circle(200,80)
t.seth(270)
t.circle(200,15)

t.penup()
t.goto(-70,90)
t.color("orange")
t.pensize("25")
t.seth(90)
t.pendown()
t.left(50)
t.circle(200,65)
t.left(10)
t.circle(200,10)

t.penup()
t.goto(-70,150)
t.seth(270)
t.pendown()
t.circle(-200,15)

#-------------右眼----------------


t.penup()
t.goto(70,150)
t.color("orange")
t.pensize("25")
t.seth(90)
t.pendown()
t.right(50)
t.circle(-200,80)
t.seth(270)
t.circle(-200,15)

t.penup()
t.goto(70,90)
t.seth(90)
t.pendown()
t.right(50)
t.circle(-200,65)
t.right(10)
t.circle(200,10)

t.penup()
t.goto(70,150)
t.seth(270)
t.pendown()
t.circle(200,15)

t.penup()
t.pensize(5)
t.color("black")
t.goto(-300,125)
t.pendown()
t.seth(0)
t.fillcolor('black')
t.begin_fill()
t.circle(15,360)
t.end_fill()

t.penup()
t.pensize(5)
t.color("black")
t.goto(100,120)
t.pendown()
t.seth(0)
t.fillcolor('black')
t.begin_fill()
t.circle(15,360)
t.end_fill()


#----------左眉毛-----------------
t.penup()
t.goto(-70,200)
t.color("black")
t.pensize("25")
t.seth(90)
t.pendown()
t.left(30)
t.circle(200,60)


#----------右眉毛-----------------
t.penup()
t.goto(70,200)
t.color("black")
t.pensize("25")
t.seth(90)
t.pendown()
t.right(30)
t.circle(-200,60)


#---------左红-------------------
t.penup()
t.color("red")
t.goto(150,20)
t.pendown()
t.fillcolor ("red")
t.begin_fill ()
t.circle(20)
t.end_fill ()

#---------右红----------------
t.penup()
t.color("red")
t.goto(-180,20)
t.pendown()
t.fillcolor ("red")
t.begin_fill ()
t.circle(20)
t.end_fill ()


t.done()

效果图

 


 



所属网站分类: 技术文章 > 博客

作者:dgfv

链接:https://www.pythonheidong.com/blog/article/6332/13e18c2a7f37859f9e71/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

0 0
收藏该文
已收藏

评论内容:(最多支持255个字符)