Fundamentals 9 min read

Drawing the 2022 Winter Olympics Mascot Bing Dwen Dwen with Python Turtle and Packaging It with PyInstaller

This article walks through creating a detailed Python Turtle drawing of the 2022 Winter Olympics mascot Bing Dwen Dwen, explains each drawing step, and shows how to package the script into a standalone executable using PyInstaller.

Python Programming Learning Circle
Python Programming Learning Circle
Python Programming Learning Circle
Drawing the 2022 Winter Olympics Mascot Bing Dwen Dwen with Python Turtle and Packaging It with PyInstaller

The author introduces a fun programming project for Valentine's Day: using Python's Turtle library to draw the 2022 Winter Olympics mascot Bing Dwen Dwen, providing a personal anecdote and motivation.

Source Code : The complete Turtle script defines the window, draws the mascot's outline, ears, limbs, facial features, rainbow rings, and adds text labels for the mascot name, Olympic venue, and the author's signature. The code is presented unchanged and wrapped in tags to preserve its exact form.</p><pre><code># python绘制2022冬奥会吉祥物--冰墩墩 # 此处左右为冰墩墩,面对我时我的观察角度所得 import turtle as t from time import sleep # 是否显示绘画过程 # t.tracer(False) t.setup(800, 600) # 设置窗体大小 t.title('涂寐送你一只冰墩墩') # 更改窗口默认标题 t.speed(10) # 设置画笔移动速度 # t.bgpic('dd.png') # 找到一张简笔画,开始疯狂的测算描边 # 隐藏光标 t.hideturtle() # 画出大致轮廓 # ... (remaining drawing commands omitted for brevity) ... t.done() Packaging Instructions : After saving the script as 冰墩墩.py , install PyInstaller with pip install pyinstaller . Use pyinstaller -F 冰墩墩.py for a console executable or pyinstaller -wF 冰墩墩.py to hide the console. Add an icon with -i bdd.ico , noting that the icon must be in .ico format. Afterword : The author reflects on the learning experience, encourages readers to type the code manually for better understanding, and shares a light‑hearted personal note about gifting the program to a spouse.

tutorialprogramming fundamentalspyinstallerbing-dwen-dwenturtle graphics
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.