您的位置:首页 > 数据 >
【turtle库】Python画图源码_当前关注
来源:CSDN 2023-01-31 09:26:21


【资料图】

Python画图我们需要使用turtle库,粘贴运行即可源码如下:import turtleturtle.setup(800, 600)turtle.speed(0)  # 速度# 左手turtle.penup()turtle.goto(177, 112)turtle.pencolor("lightgray")turtle.pensize(3)turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(80)turtle.circle(-45, 200)turtle.circle(-300, 23)turtle.end_fill()# 左手内turtle.penup()turtle.goto(182, 95)turtle.pencolor("black")turtle.pensize(1)turtle.fillcolor("black")turtle.begin_fill()turtle.setheading(95)turtle.pendown()turtle.circle(-37, 160)turtle.circle(-20, 50)turtle.circle(-200, 30)turtle.end_fill()# 轮廓头顶turtle.penup()turtle.goto(-73, 230)turtle.pencolor("lightgray")turtle.pensize(3)turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(20)turtle.circle(-250, 35)# 左耳turtle.setheading(50)turtle.circle(-42, 180)# 左侧turtle.setheading(-50)turtle.circle(-190, 30)turtle.circle(-320, 45)# 左腿turtle.circle(120, 30)turtle.circle(200, 12)turtle.circle(-18, 85)turtle.circle(-180, 23)turtle.circle(-20, 110)turtle.circle(15, 115)turtle.circle(100, 12)# 右腿turtle.circle(15, 120)turtle.circle(-15, 110)turtle.circle(-150, 30)turtle.circle(-15, 70)turtle.circle(-150, 10)turtle.circle(200, 35)turtle.circle(-150, 20)# 右手turtle.setheading(-120)turtle.circle(50, 30)turtle.circle(-35, 200)turtle.circle(-300, 23)# 右侧turtle.setheading(86)turtle.circle(-300, 26)# 右耳turtle.setheading(122)turtle.circle(-53, 160)turtle.end_fill()# 右耳内侧turtle.penup()turtle.goto(-130, 180)turtle.pencolor("black")turtle.pensize(1)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.setheading(120)turtle.circle(-28, 160)turtle.setheading(210)turtle.circle(150, 20)turtle.end_fill()# 右耳内侧turtle.penup()turtle.goto(-130, 180)turtle.pencolor("black")turtle.pensize(1)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.setheading(120)turtle.circle(-28, 160)turtle.setheading(210)turtle.circle(150, 20)turtle.end_fill()# 左耳内侧turtle.penup()turtle.goto(90, 230)turtle.setheading(40)turtle.begin_fill()turtle.pendown()turtle.circle(-30, 170)turtle.setheading(125)turtle.circle(150, 23)turtle.end_fill()# 右手内侧turtle.penup()turtle.goto(-180, -55)turtle.fillcolor("black")turtle.begin_fill()turtle.setheading(-120)turtle.setheading(-120)turtle.pendown()turtle.circle(50, 30)turtle.circle(-27, 200)turtle.circle(-300, 20)turtle.setheading(-90)turtle.circle(300, 14)turtle.end_fill()# 左腿内侧turtle.penup()turtle.goto(108, -168)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.setheading(-115)turtle.circle(110, 15)turtle.circle(200, 10)turtle.circle(-18, 80)turtle.circle(-180, 13)turtle.circle(-20, 90)turtle.circle(15, 60)turtle.setheading(42)turtle.circle(-200, 29)turtle.end_fill()# 右腿内侧turtle.penup()turtle.goto(-38, -210)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.setheading(-155)turtle.circle(15, 100)turtle.circle(-10, 110)turtle.circle(-100, 30)turtle.circle(-15, 65)turtle.circle(-100, 10)turtle.circle(200, 15)turtle.setheading(-14)turtle.circle(-200, 27)turtle.end_fill()# 右眼眼圈turtle.penup()turtle.goto(-64, 120)turtle.begin_fill()turtle.pendown()turtle.setheading(40)turtle.circle(-35, 152)turtle.circle(-100, 50)turtle.circle(-35, 130)turtle.circle(-100, 50)turtle.end_fill()# 眼珠turtle.penup()turtle.goto(-47, 55)turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(25, 360)turtle.end_fill()turtle.penup()turtle.goto(-45, 62)turtle.pencolor("darkslategray")turtle.fillcolor("darkslategray")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(19, 360)turtle.circle(19, 360)turtle.end_fill()turtle.penup()turtle.goto(-45, 68)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(10, 360)turtle.end_fill()turtle.penup()turtle.goto(-47, 86)turtle.pencolor("white")turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(5, 360)turtle.circle(5, 360)turtle.end_fill()# 左眼眼圈turtle.penup()turtle.goto(51, 82)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.setheading(120)turtle.circle(-32, 152)turtle.circle(-100, 55)turtle.circle(-25, 120)turtle.circle(-120, 45)turtle.end_fill()# 眼珠turtle.penup()turtle.goto(79, 60)turtle.goto(79, 60)turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(24, 360)turtle.end_fill()turtle.penup()turtle.goto(79, 64)turtle.pencolor("darkslategray")turtle.fillcolor("darkslategray")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(19, 360)turtle.end_fill()turtle.penup()turtle.goto(79, 70)turtle.goto(79, 70)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(10, 360)turtle.end_fill()turtle.penup()turtle.goto(79, 88)turtle.pencolor("white")turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(0)turtle.circle(5, 360)turtle.end_fill()# 鼻子turtle.penup()turtle.goto(37, 80)turtle.fillcolor("black")turtle.begin_fill()turtle.pendown()turtle.circle(-8, 130)turtle.circle(-22, 100)turtle.circle(-8, 130)turtle.end_fill()# 嘴turtle.penup()turtle.goto(-15, 48)turtle.setheading(-36)turtle.begin_fill()turtle.pendown()turtle.circle(60, 70)turtle.setheading(-132)turtle.circle(-45, 100)turtle.end_fill()# 彩虹图turtle.penup()turtle.goto(-135, 120)turtle.pensize(5)turtle.pencolor("cyan")turtle.pendown()turtle.setheading(60)turtle.circle(-165, 150)turtle.circle(-130, 78)turtle.circle(-250, 30)turtle.circle(-138, 105)turtle.penup()turtle.goto(-131, 116)turtle.pencolor("slateblue")turtle.pendown()turtle.setheading(60)turtle.setheading(60)turtle.circle(-160, 144)turtle.circle(-120, 78)turtle.circle(-242, 30)turtle.circle(-135, 105)turtle.penup()turtle.goto(-127, 112)turtle.pencolor("orangered")turtle.pendown()turtle.setheading(60)turtle.circle(-155, 136)turtle.circle(-116, 86)turtle.circle(-220, 30)turtle.circle(-134, 103)turtle.penup()turtle.goto(-123, 108)turtle.pencolor("gold")turtle.pendown()turtle.setheading(60)turtle.circle(-150, 136)turtle.circle(-104, 86)turtle.circle(-220, 30)turtle.circle(-126, 102)turtle.penup()turtle.goto(-120, 104)turtle.pencolor("greenyellow")turtle.pendown()turtle.setheading(60)turtle.circle(-145, 136)turtle.circle(-90, 83)turtle.circle(-220, 30)turtle.circle(-120, 100)turtle.penup()# 爱心turtle.penup()turtle.goto(220, 115)turtle.pencolor("brown")turtle.pensize(1)turtle.fillcolor("brown")turtle.begin_fill()turtle.pendown()turtle.setheading(36)turtle.circle(-8, 180)turtle.circle(-60, 24)turtle.setheading(110)turtle.circle(-60, 24)turtle.circle(-8, 180)turtle.end_fill()# 五环turtle.penup()turtle.goto(-20, -170)turtle.pendown()turtle.pencolor("blue")turtle.pensize(2)turtle.circle(7)turtle.penup()turtle.goto(-5, -170)turtle.pendown()turtle.pencolor("black")turtle.pensize(2)turtle.circle(7)turtle.penup()turtle.goto(10, -170)turtle.pendown()turtle.pencolor("brown")turtle.pensize(2)turtle.circle(7)turtle.penup()turtle.goto(-17, -175)turtle.pendown()turtle.pencolor("lightgoldenrod")turtle.pensize(2)turtle.circle(7)turtle.penup()turtle.goto(1, -175)turtle.pendown()turtle.pencolor("green")turtle.pensize(2)turtle.circle(7)turtle.penup()turtle.pencolor("black")turtle.goto(-35, -160)turtle.write("BEIJING2022", font=("Arial", 10, "bold italic"))turtle.hideturtle()turtle.done()

关键词:
相关文章
山西焦煤节日期间安全生产平稳有序

山西焦煤节日期间安全生产平稳有序

  春节长假期间,山西焦煤深入贯彻党的二十大关于加强能源安全供应能力建设的精神,严格落实省委、省政府关于煤炭增产保供各项决策部署,坚更多

2023-01-30 10:58:51
环球快消息!新疆最大煤炭产销企业春节产销两旺

环球快消息!新疆最大煤炭产销企业春节产销两旺

  春节期间,国家能源集团新疆能源有限责任公司日生产煤炭约24万吨,有力保障疆内外供暖、电力等重点企业的煤炭供应。图为国家能源集团新疆更多

2023-01-30 10:15:33
2022年12月份福建省煤炭市场价格稳中上涨|微动态

2022年12月份福建省煤炭市场价格稳中上涨|微动态

  根据商务部重要生产资料监测系统数据显示,2022年12月份,福建省监测样本企业的煤炭市场价格平均为162917元吨,环比上涨02%。其中无烟煤市更多

2023-01-30 09:57:40
1月第二周四川省煤炭价格小幅下降-世界微资讯

1月第二周四川省煤炭价格小幅下降-世界微资讯

  据商务部重要生产资料市场监测系统显示,上周(1月9日-15日)四川省煤炭均价为98709元吨,环比下降16%。其中,动力煤、无烟煤价格分别为105更多

2023-01-30 09:53:16
环球头条:1月第三周内蒙古煤炭价格环比下降

环球头条:1月第三周内蒙古煤炭价格环比下降

  据商务部重要生产资料市场监测系统数据显示:(1月14日-1月20日),从监测品种样本数据来看煤炭平均价格为84466元吨,与前一周比(下称环更多

2023-01-30 09:55:49
CCTD:高库存压制节后煤炭市场

CCTD:高库存压制节后煤炭市场

  假期市场情况综述  产地方面,假日及节后归来首日呈现供需两弱的局面,价格保持平稳运行。主流大矿多短休为主,维持相对平稳生产,中小更多

2023-01-30 09:58:48
观点:1月以来大秦铁路煤炭运输突破3000万吨

观点:1月以来大秦铁路煤炭运输突破3000万吨

  从中国铁路太原局了解到,今年以来,中国铁路太原局充分发挥大秦铁路能源通道作用,优先保障电煤运输,提高电煤装车比重,1月份以来(截至更多

2023-01-29 12:18:01
全球热资讯!1月第二周河南省洛阳市煤炭价格环比上涨

全球热资讯!1月第二周河南省洛阳市煤炭价格环比

  据商务部业务系统统一平台洛阳市重要生产资料监测系统数据显示,上周(1月7日-1月13日)洛阳市煤炭(烟煤)平均零售价为7615元吨,环比上更多

2023-01-29 10:07:02
今日快讯:1月第二周山西省煤炭价格微幅上涨

今日快讯:1月第二周山西省煤炭价格微幅上涨

  据山西省商务厅生产资料市场监测数据显示:(1月9日-15日)山西省煤炭均价13109元吨,环比上涨09%。其中,无烟煤2号均价1648元吨,环比上更多

2023-01-29 10:11:23
2022年12月山西省煤炭价格以涨为主-环球报资讯

2022年12月山西省煤炭价格以涨为主-环球报资讯

  监测系统数据显示:12月份山西煤炭价格以涨为主。煤炭平均价格为130475元吨,环比上涨14%。其中:无烟煤2号洗选块煤平均价格为16156元吨,更多

2023-01-29 10:04:11