小伙利用Python绘制999种玫瑰花表白女神,会编程男孩子真好
前言Python的应用领域非常的广泛,可以做web开发、爬虫、自动化、数据分析、人工智能 等等,对于绘画,Python也是有一个专门的库:turtle。利用python绘制一朵玫瑰,快拿去...
·
前言
Python的应用领域非常的广泛,可以做web开发、爬虫、自动化、数据分析、人工智能 等等,对于绘画,Python也是有一个专门的库:turtle。
利用python绘制一朵玫瑰,快拿去送给你心爱的人吧!(省钱,好看,关键还耐用)
Python绘制一朵漂亮的玫瑰花,用python的turtle库这个绘画库是非常简单的,但是还是需要你测试路径方向,慢慢调试,小编这里不可能把999种玫瑰花的代码全部贴上来,下面的代码具有一定的参考价值
源码获取:
1点击下方卡片
2. 回复关键词:玫瑰
关注公众号:python自留地
祝愿单身早日脱单
代码:
送人玫瑰,手有余香
代码:
愿你的人生路上充满了玫瑰花
代码:
import turtle as t
t.setup(1100,1000)
t.hideturtle()
t.speed(11)
t.penup()
t.goto(50,-450)
t.pensize(5)
t.pencolor("black")
t.seth(140)
t.pendown()
t.speed(10)
t.circle(-300,60)
t.fd(100)
#jiaodu80
#1ye
t.seth(10)
t.fd(50)
t.fillcolor("green")
t.begin_fill()
t.right(40)
t.circle(120,80)
t.left(100)
t.circle(120,80)
t.end_fill()
t.seth(10)
t.fd(90)
t.speed(11)
t.penup()
t.fd(-140)
t.seth(80)
#2ye
t.pendown()
t.speed(10)
t.fd(70)
t.seth(160)
t.fd(50)
t.fillcolor("green")
t.begin_fill()
t.right(40)
t.circle(120,80)
t.left(100)
t.circle(120,80)
t.end_fill()
t.seth(160)
t.fd(90)
t.speed(11)
t.penup()
t.fd(-140)
t.seth(80)
t.pendown()
t.speed(10)
#
t.fd(100)
#1ban
t.seth(-20)
t.fillcolor("crimson")
t.begin_fill()
t.circle(100,100)
t.circle(-110,70)
t.seth(179)
t.circle(223,76)
t.end_fill()
#2ban
t.speed(11)
t.fillcolor("red")
t.begin_fill()
t.left(180)
t.circle(-223,60)
t.seth(70)
t.speed(10)
t.circle(-213,15)#55
t.left(70)#125
t.circle(200,70)
t.seth(-80)
t.circle(-170,40)
t.circle(124,94)
t.end_fill()
#
t.speed(11)
t.penup()
t.right(180)
t.circle(-124,94)
t.circle(170,40)
t.pendown()
t.speed(10)
t.seth(-60)
t.circle(175,70)
t.seth(235)
t.circle(300,12)
t.right(180)
t.circle(-300,12)
t.seth(125)
t.circle(150,60)
t.seth(70)
t.fd(-20)
t.fd(20)
t.seth(-45)
t.circle(150,40)
t.seth(66)
t.fd(-18.5)
t.fd(18.5)
t.seth(140)
t.circle(150,27)
t.seth(60)
t.fd(-8)
t.speed(11)
t.penup()
t.left(20.8)
t.fd(-250.5)
#3ban
t.pendown()
t.speed(10)
t.fillcolor("crimson")
t.begin_fill()
t.seth(160)
t.circle(-140,85)
t.circle(100,70)
t.right(165)
t.circle(-200,32)
t.speed(11)
t.seth(-105)
t.circle(-170,14.5)
t.circle(123,94)
t.end_fill()
有女友写代码,没有女朋友更要写代码
几何玫瑰
代码
难道Python只能画一些玫瑰花来表白就完事了么?
此这篇关于python绘制玫瑰的实现代码的文章就介绍到这了
相关阅读:教你用python画动态爱心
源码获取:
1.扫描下方二维码
2. 回复关键词:玫瑰
长按上方二维码 2 秒
回复「玫瑰」即可获取源码
关注公众号:python自留地
我是老曾(个人微信: tuling060 ) 备注 888建了个微信群,互相解答问题,分享精选电子书,带大家白嫖各种福利,有需要的同学可以加我微信进群。
更多推荐
已为社区贡献6条内容
所有评论(0)