The guy uses Python to draw 999 kinds of roses to express the goddess, it's good for boys to know programming

foreword

Python has a very wide range of applications, which can be used for web development, crawling, automation, data analysis, artificial intelligence, etc. For painting, Python also has a special library: turtle.

Use python to draw a rose and give it to your loved one! (Save money, look good, and the key is durable)

Python draws a beautiful rose. Using python's turtle library is a very simple drawing library, but you still need to test the path direction and debug slowly. It is impossible for me to paste all the codes of 999 kinds of roses here. The following code has certain reference value

Source code acquisition:

1 Click the card below

2. Reply keyword: rose

Pay attention to the public number: python private land

I wish the single to get rid of the single soon

1e5081377f37c927e5832314367b72c3.png

Code:

e3e8e0d060be422648f9a943f84b7df3.png

helping people makes a person happy

c6191372e6a2478a73dc2fc624dbeea5.png

Code:

99649af8b38c534e24cf79a12d668a8a.png

May your life be filled with roses

55ea93218ab87dca7b3f4e2be1af41fe.png

Code:

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()

If you have a girlfriend to write code, you have to write code without a girlfriend

geometric rose

4e41ca32f397d65017b4e88252c0637d.gif

code

Is it enough that Python can only draw some roses to express their feelings? 

fbd5c0144fc82737aa3a6f00e6c04ca5.png

This article about the implementation code of python drawing roses is introduced here

Related reading: Teach you to draw dynamic hearts with python

Source code acquisition:

1. Scan the QR code below

2. Reply keyword: rose

9327311d4a8c5441aa9bd624c7b98399.png

Press and hold the QR code above for 2 seconds 

Reply to " rose " to get the source code

Pay attention to the public number: python private land

我是老曾(个人微信: tuling060 ) 备注 888建了个微信群,互相解答问题,分享精选电子书,带大家白嫖各种福利,有需要的同学可以加我微信进群。

Guess you like

Origin blog.csdn.net/bigzql/article/details/122935267