Fundamentals 28 min read

Python Turtle Valentine's Day Drawing Collection: Roses, Hearts, Cupid, Cherry Blossom Tree and More

This tutorial presents a collection of Python Turtle scripts that generate various romantic 520-themed graphics—including roses, heart shapes, Cupid figures, animated cherry blossom trees, heart-shaped word clouds, and a girlfriend portrait—complete with ready-to-run code for each illustration.

Python Programming Learning Circle
Python Programming Learning Circle
Python Programming Learning Circle
Python Turtle Valentine's Day Drawing Collection: Roses, Hearts, Cupid, Cherry Blossom Tree and More

This article shares a series of Python Turtle scripts to create romantic 520-themed graphics, such as a simple rose, a rose combined with hearts, multiple heart designs, a Cupid figure, an animated cherry‑blossom tree, a heart‑shaped word cloud, and a girlfriend portrait rendered as ASCII art.

Each section briefly describes the visual effect and provides the full source code, which can be copied and executed directly to produce the drawing.

1. Simple Rose

Implementation code:

<code>from turtle import *</code><code>import time</code><code>setup(1000,800,0,0)</code><code>speed(0)</code><code>penup()</code><code>seth(90)</code><code>fd(340)</code><code>seth(0)</code><code>pendown()</code><code>speed(5)</code><code>begin_fill()</code><code>fillcolor('red')</code><code>circle(50,30)</code><code>for i in range(10):</code><code>    fd(1)</code><code>    left(10)</code><code>circle(40,40)</code><code>for i in range(6):</code><code>    fd(1)</code><code>    left(3)</code><code>circle(80,40)</code><code>for i in range(20):</code><code>    fd(0.5)</code><code>    left(5)</code><code>circle(80,45)</code><code>for i in range(10):</code><code>    fd(2)</code><code>    left(1)</code><code>circle(80,25)</code><code>for i in range(20):</code><code>    fd(1)</code><code>    left(4)</code><code>circle(50,50)</code><code>time.sleep(0.1)</code><code>circle(120,55)</code><code>speed(0)</code><code>seth(-90)</code><code>fd(70)</code><code>right(150)</code><code>fd(20)</code><code>left(140)</code><code>circle(140,90)</code><code>left(30)</code><code>circle(160,100)</code><code>left(130)</code><code>fd(25)</code><code>penup()</code><code>right(150)</code><code>circle(40,80)</code><code>pendown()</code><code>left(115)</code><code>fd(60)</code><code>penup()</code><code>left(180)</code><code>fd(60)</code><code>pendown()</code><code>end_fill()</code><code>right(120)</code><code>circle(-50,50)</code><code>circle(-20,90)</code><code>speed(1)</code><code>fd(75)</code><code>speed(0)</code><code>circle(90,110)</code><code>penup()</code><code>left(162)</code><code>fd(185)</code><code>left(170)</code><code>pendown()</code><code>circle(200,10)</code><code>circle(100,40)</code><code>circle(-52,115)</code><code>left(20)</code><code>circle(100,20)</code><code>circle(300,20)</code><code>speed(1)</code><code>fd(250)</code><code>penup()</code><code>speed(0)</code><code>left(180)</code><code>fd(250)</code><code>circle(-300,7)</code><code>right(80)</code><code>circle(200,5)</code><code>pendown()</code><code>left(60)</code><code>begin_fill()</code><code>fillcolor('green')</code><code>circle(-80,100)</code><code>right(90)</code><code>fd(10)</code><code>left(20)</code><code>circle(-63,127)</code><code>end_fill()</code><code>penup()</code><code>left(50)</code><code>fd(20)</code><code>left(180)</code><code>pendown()</code><code>circle(200,25)</code><code>penup()</code><code>right(150)</code><code>fd(180)</code><code>right(40)</code><code>pendown()</code><code>begin_fill()</code><code>fillcolor('green')</code><code>circle(-100,80)</code><code>right(150)</code><code>fd(10)</code><code>left(60)</code><code>circle(-80,98)</code><code>end_fill()</code><code>penup()</code><code>left(60)</code><code>fd(13)</code><code>left(180)</code><code>pendown()</code><code>speed(1)</code><code>circle(-200,23)</code><code>exitonclick()</code>

2. Rose with Hearts

Implementation code:

<code>import turtle</code><code>import time</code><code>import random</code><code>def yellowheart(x, y, liftx):</code><code>    turtle.pensize(3)</code><code>    turtle.speed(10)</code><code>    turtle.color("red", "red")</code><code>    turtle.up()</code><code>    turtle.goto(x, y)</code><code>    turtle.down()</code><code>    turtle.begin_fill()</code><code>    turtle.left(liftx)</code><code>    turtle.fd(80)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(90)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(0)</code><code>    turtle.fd(80)</code><code>    turtle.end_fill()</code><code>def rose():</code><code>    turtle.speed(0)</code><code>    turtle.penup()</code><code>    turtle.left(90)</code><code>    turtle.fd(200)</code><code>    turtle.pendown()</code><code>    turtle.right(90)</code><code>    turtle.pensize(2)</code><code>    turtle.fillcolor("red")</code><code>    turtle.begin_fill()</code><code>    turtle.circle(10, 180)</code><code>    turtle.circle(25, 110)</code><code>    turtle.left(50)</code><code>    turtle.circle(60, 45)</code><code>    turtle.circle(20, 170)</code><code>    turtle.right(24)</code><code>    turtle.fd(30)</code><code>    turtle.left(10)</code><code>    turtle.circle(30, 110)</code><code>    turtle.fd(20)</code><code>    turtle.left(40)</code><code>    turtle.circle(90, 70)</code><code>    turtle.circle(30, 150)</code><code>    turtle.right(30)</code><code>    turtle.fd(15)</code><code>    turtle.circle(80, 90)</code><code>    turtle.left(15)</code><code>    turtle.fd(45)</code><code>    turtle.right(165)</code><code>    turtle.fd(20)</code><code>    turtle.left(155)</code><code>    turtle.circle(150, 80)</code><code>    turtle.left(50)</code><code>    turtle.circle(150, 90)</code><code>    turtle.end_fill()</code><code>    turtle.left(150)</code><code>    turtle.circle(-90, 70)</code><code>    turtle.left(20)</code><code>    turtle.circle(75, 105)</code><code>    turtle.setheading(60)</code><code>    turtle.circle(80, 98)</code><code>    turtle.circle(-90, 40)</code><code>    turtle.left(180)</code><code>    turtle.circle(90, 40)</code><code>    turtle.circle(-80, 98)</code><code>    turtle.setheading(-83)</code><code>    turtle.pensize(3)</code><code>    turtle.fillcolor("green")</code><code>    turtle.begin_fill()</code><code>    turtle.circle(-80, 90)</code><code>    turtle.right(90)</code><code>    turtle.circle(-80, 90)</code><code>    turtle.end_fill()</code><code>    turtle.right(135)</code><code>    turtle.fd(60)</code><code>    turtle.left(180)</code><code>    turtle.fd(85)</code><code>    turtle.left(90)</code><code>    turtle.fd(80)</code><code>    turtle.right(90)</code><code>    turtle.right(45)</code><code>    turtle.fillcolor("green")</code><code>    turtle.begin_fill()</code><code>    turtle.circle(80, 90)</code><code>    turtle.left(90)</code><code>    turtle.circle(80, 90)</code><code>    turtle.end_fill()</code><code>    turtle.left(135)</code><code>    turtle.fd(60)</code><code>    turtle.left(180)</code><code>    turtle.fd(60)</code><code>    turtle.right(90)</code><code>    turtle.circle(200, 50)</code><code>    time.sleep(1)</code><code>    turtle.color("red", "red")</code><code>    turtle.up()</code><code>    turtle.goto(-230, 50)</code><code>    turtle.down()</code><code>    turtle.begin_fill()</code><code>    turtle.left(180)</code><code>    turtle.fd(80)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(90)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(0)</code><code>    turtle.fd(80)</code><code>    turtle.end_fill()</code><code>    time.sleep(1)</code><code>    turtle.up()</code><code>    turtle.goto(-230, -80)</code><code>    turtle.down()</code><code>    turtle.begin_fill()</code><code>    turtle.left(-30)</code><code>    turtle.fd(80)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(90)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(0)</code><code>    turtle.fd(80)</code><code>    turtle.end_fill()</code><code>    time.sleep(1)</code><code>    turtle.up()</code><code>    turtle.goto(-130, -180)</code><code>    turtle.down()</code><code>    turtle.begin_fill()</code><code>    turtle.left(-80)</code><code>    turtle.fd(80)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(90)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(0)</code><code>    turtle.fd(80)</code><code>    turtle.end_fill()</code><code>    time.sleep(1)</code><code>    turtle.up()</code><code>    turtle.goto(200, -200)</code><code>    turtle.down()</code><code>    turtle.begin_fill()</code><code>    turtle.left(-90)</code><code>    turtle.fd(80)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(90)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(0)</code><code>    turtle.fd(80)</code><code>    turtle.end_fill()</code><code>    time.sleep(1)</code><code>    turtle.up()</code><code>    turtle.goto(200, 50)</code><code>    turtle.down()</code><code>    turtle.begin_fill()</code><code>    turtle.left(90)</code><code>    turtle.fd(80)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(90)</code><code>    turtle.circle(-40, 180)</code><code>    turtle.left(0)</code><code>    turtle.fd(80)</code><code>    turtle.end_fill()</code><code>def figure1():</code><code>    turtle.reset()</code><code>    turtle.tracer(False)</code><code>    rose()</code><code>    yellowheart(-230, 50, 180)</code><code>def figure2():</code><code>    turtle.tracer(False)</code><code>    rose()</code><code>    yellowheart(-230, -80, -30)</code><code>def figure3():</code><code>    turtle.reset()</code><code>    turtle.tracer(False)</code><code>    rose()</code><code>    yellowheart(-130, -180, -30)</code><code>def figure4():</code><code>    turtle.reset()</code><code>    turtle.tracer(False)</code><code>    rose()</code><code>    yellowheart(200, 50, 90)</code><code>def figure5():</code><code>    turtle.reset()</code><code>    turtle.tracer(False)</code><code>    rose()</code><code>    yellowheart(200, -200, -90)</code><code>if __name__ == "__main__":</code><code>    rose()</code><code>    turtle.done()</code>

3. Heart Shape

Implementation code:

<code>from turtle import *</code><code>from time import sleep</code><code>def go_to(x, y):</code><code>    up()</code><code>    goto(x, y)</code><code>    down()</code><code>def small_Circle(size):</code><code>    speed(10)</code><code>    for i in range(210):</code><code>        forward(size)</code><code>        right(0.786)</code><code>def big_Circle(size):</code><code>    speed(10)</code><code>    for i in range(150):</code><code>        forward(size)</code><code>        right(0.3)</code><code>def line(size):</code><code>    speed(10)</code><code>    forward(51 * size)</code><code>def heart(x, y, size):</code><code>    go_to(x, y)</code><code>    left(150)</code><code>    begin_fill()</code><code>    line(size)</code><code>    big_Circle(size)</code><code>    small_Circle(size)</code><code>    left(120)</code><code>    small_Circle(size)</code><code>    big_Circle(size)</code><code>    line(size)</code><code>    end_fill()</code><code>def main():</code><code>    pensize(2)</code><code>    color('red', 'pink')</code><code>    getscreen().tracer(1, 0)</code><code>    heart(100, 0, 0.7)</code><code>    go_to(80, 70)</code><code>    write("先生", font=("楷体", 18, "normal"))</code><code>    setheading(0)</code><code>    heart(-80, -100, 1)</code><code>    go_to(-110, 15)</code><code>    write("小姐", font=("宋体", 20, "normal"))</code><code>    go_to(40, -80)</code><code>    write("三生有幸遇见你!", move=True, align="left", font=("arial", 22, "italic"))</code><code>    done()</code><code>main()</code>

4. Pink Heart

Implementation code:

<code>'''不正经爱心'''</code><code>#coding=utf-8</code><code>import turtle</code><code>import time</code><code>def draw_circle():</code><code>    for i in range(400):</code><code>        turtle.right(0.5)</code><code>        turtle.forward(1)</code><code>def draw_love():</code><code>    turtle.pen(fillcolor="pink", pencolor="red", pensize=8)</code><code>    turtle.speed(2000)</code><code>    turtle.goto(0,0)</code><code>    turtle.begin_fill()</code><code>    turtle.left(140)</code><code>    turtle.forward(224)</code><code>    draw_circle()</code><code>    turtle.left(120)</code><code>    draw_circle()</code><code>    turtle.forward(224)</code><code>    turtle.end_fill()</code><code>    turtle.write("I Love you")</code><code>    time.sleep(2)</code><code>    turtle.up()</code><code>    turtle.goto(150,20)</code><code>    turtle.color('black')</code><code>    turtle.write('纵然万劫不复,纵然相思入骨,我待你依旧如初!', font=("微软雅黑",18,"normal"))</code><code>    time.sleep(2)</code><code>def draw_abc():</code><code>    turtle.fillcolor("pink")</code><code>    turtle.pencolor("red")</code><code>    turtle.pensize(10)</code><code>    turtle.speed(1)</code><code>    turtle.up()</code><code>    turtle.goto(0,-50)</code><code>    turtle.down()</code><code>    turtle.begin_fill()</code><code>    turtle.circle(45)</code><code>    turtle.end_fill()</code><code>    time.sleep(2)</code><code>def word():</code><code>    turtle.up()</code><code>    turtle.goto(-100,200)</code><code>    turtle.color("red")</code><code>    turtle.pensize(4)</code><code>    turtle.write('宝贝,5.20快乐!', font=("隶书",18,"bold"))</code><code>    time.sleep(10)</code><code>draw_love()</code><code>draw_abc()</code><code>word()</code>

5. Cupid Figure

Implementation code:

<code>import turtle as t</code><code>t.color('red','pink')</code><code>t.begin_fill()</code><code>t.width(5)</code><code>t.left(135)</code><code>t.fd(100)</code><code>t.right(180)</code><code>t.circle(50,-180)</code><code>t.left(90)</code><code>t.circle(50,-180)</code><code>t.right(180)</code><code>t.fd(100)</code><code>t.pu()</code><code>t.goto(50,-30)</code><code>t.pd()</code><code>t.right(90)</code><code>t.fd(100)</code><code>t.right(180)</code><code>t.circle(50,-180)</code><code>t.left(90)</code><code>t.circle(50,-180)</code><code>t.right(180)</code><code>t.fd(100)</code><code>t.end_fill()</code><code>t.hideturtle()</code><code>t.pu()</code><code>t.goto(250,-70)</code><code>t.pd()</code><code>t.color('black')</code><code>t.width(5)</code><code>t.left(70)</code><code>t.fd(50)</code><code>t.fd(-50)</code><code>t.left(70)</code><code>t.fd(50)</code><code>t.fd(-50)</code><code>t.left(145)</code><code>t.fd(20)</code><code>t.left(145)</code><code>t.fd(50)</code><code>t.fd(-50)</code><code>t.left(70)</code><code>t.fd(50)</code><code>t.fd(-50)</code><code>t.left(145)</code><code>t.fd(20)</code><code>t.left(145)</code><code>t.fd(50)</code><code>t.fd(-50)</code><code>t.left(70)</code><code>t.fd(50)</code><code>t.fd(-50)</code><code>t.left(145)</code><code>t.width(3)</code><code>t.fd(220)</code><code>t.right(90)</code><code>t.pu()</code><code>t.fd(10)</code><code>t.pd()</code><code>t.left(90)</code><code>t.circle(10,180)</code><code>t.circle(10,-90)</code><code>t.right(90)</code><code>t.fd(-10)</code><code>t.pu()</code><code>t.fd(90)</code><code>t.left(90)</code><code>t.fd(10)</code><code>t.left(90)</code><code>t.pd()</code><code>t.circle(10,180)</code><code>t.circle(10,-90)</code><code>t.left(90)</code><code>t.fd(100)</code><code>t.begin_fill()</code><code>t.left(30)</code><code>t.fd(15)</code><code>t.right(35)</code><code>t.fd(50)</code><code>t.right(150)</code><code>t.fd(50)</code><code>t.right(62)</code><code>t.fd(25)</code><code>t.end_fill()</code><code>t.done()</code>

6. Animated Cherry Blossom Tree

Implementation code:

<code>import turtle as T</code><code>import random</code><code>import time</code><code>def Tree(branch, t):</code><code>    time.sleep(0.0005)</code><code>    if branch > 3:</code><code>        if 8 <= branch <= 12:</code><code>            if random.randint(0,2) == 0:</code><code>                t.color('snow')</code><code>            else:</code><code>                t.color('lightcoral')</code><code>            t.pensize(branch / 3)</code><code>        elif branch < 8:</code><code>            if random.randint(0,1) == 0:</code><code>                t.color('snow')</code><code>            else:</code><code>                t.color('lightcoral')</code><code>            t.pensize(branch / 2)</code><code>        else:</code><code>            t.color('sienna')</code><code>            t.pensize(branch / 10)</code><code>        t.forward(branch)</code><code>        a = 1.5 * random.random()</code><code>        t.right(20 * a)</code><code>        b = 1.5 * random.random()</code><code>        Tree(branch - 10 * b, t)</code><code>        t.left(40 * a)</code><code>        Tree(branch - 10 * b, t)</code><code>        t.right(20 * a)</code><code>        t.up()</code><code>        t.backward(branch)</code><code>        t.down()</code><code>def Petal(m, t):</code><code>    for i in range(m):</code><code>        a = 200 - 400 * random.random()</code><code>        b = 10 - 20 * random.random()</code><code>        t.up()</code><code>        t.forward(b)</code><code>        t.left(90)</code><code>        t.forward(a)</code><code>        t.down()</code><code>        t.color('lightcoral')</code><code>        t.circle(1)</code><code>        t.up()</code><code>        t.backward(a)</code><code>        t.right(90)</code><code>        t.backward(b)</code><code>t = T.Turtle()</code><code>w = T.Screen()</code><code>t.hideturtle()</code><code>t.getscreen().tracer(5,0)</code><code>w.screensize(bg='wheat')</code><code>t.left(90)</code><code>t.up()</code><code>t.backward(150)</code><code>t.down()</code><code>t.color('sienna')</code><code>Tree(60, t)</code><code>Petal(200, t)</code><code>w.exitonclick()</code>

7. Heart‑Shaped Word Cloud

Implementation code:

<code>from wordcloud import WordCloud</code><code>import PIL.Image as image</code><code>import numpy as np</code><code>import jieba</code><code># 分词</code><code>def trans_CN(text):</code><code>    word_list = jieba.cut(text)</code><code>    result = " ".join(word_list)</code><code>    return result</code><code>with open("love.txt", encoding="utf-8") as fp:</code><code>    text = fp.read()</code><code>    text = trans_CN(text)</code><code>    mask = np.array(image.open("love.png"))</code><code>    wordcloud = WordCloud(mask=mask, font_path="C:\\Windows\\Fonts\\STXINGKA.TTF").generate(text)</code><code>    image_produce = wordcloud.to_image()</code><code>    image_produce.show()</code>

8. Girlfriend Portrait ASCII Art

Implementation code:

<code>from PIL</code><code>from PIL import Image, ImageDraw, ImageFont</code><code>def draw(pic, draw_text):</code><code>    img = cv2.imread(pic)</code><code>    blank = Image.new("RGB", [img.shape[1], img.shape[0]], "white")</code><code>    drawObj = ImageDraw.Draw(blank)</code><code>    n = 10</code><code>    m = 9</code><code>    font = ImageFont.truetype(font_path, size=m)</code><code>    for i in range(0, img.shape[0], n):</code><code>        for j in range(0, img.shape[1], n):</code><code>            drawObj.text([j, i], draw_text[int(j / n) % len(draw_text)], fill=(img[i][j][2], img[i][j][1], img[i][j][0]), font=font)</code><code>    blank.save('img_' + pic)</code><code>draw('1.jpg', "我爱你")</code>

The article concludes with a reminder to follow the public account for more Python tutorials and a QR code offering free Python learning resources.

graphicsPythonTutorialvisualizationcodeturtlelove
Python Programming Learning Circle
Written by

Python Programming Learning Circle

A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.