?草莓熊python turtle繪圖代碼(玫瑰花版)附源代碼
本文目錄:
一、前言
二、草莓熊手持玫瑰花成品效果圖
三、代碼演示方法和代碼命令解釋
四、草莓熊手持的玫瑰花源代碼
五、相關(guān)資源圖片
六、我的“草莓熊python turtle繪圖(玫瑰花版)”繪圖源代碼
七、草莓熊python turtle繪圖(風(fēng)車版)附源代碼
八、怎么才能正常運行python turtle繪圖代碼(本機運行、打包發(fā)給別人)
九、?草莓熊python turtle繪圖(圣誕元旦倒數(shù)雪花版)附源代碼
一、前言
?? 我(逆境清醒)博客中的代碼是完整源代碼,你從我博客拷貝代碼后本機運行就能看到和我博客上同樣的運行效果(只要我網(wǎng)絡(luò)沒有被全h)。我樂意分享,不需要你去關(guān)注任何賬號,不強求任何人成為我的粉絲,也不需要你以任何形式購買源代碼,只要你是個人學(xué)習(xí)用,或者通過我的代碼能帶給你身邊的朋友開心快樂,我愿意為此盡一分力。
?? 請記住,不要從其他地方下載和購買我的繪圖代碼(包括可執(zhí)行的exe文件,小心代碼被篡改有病毒)?。我只有一個博客,就是CSDN的,逆境清醒的博客: https://blog.csdn.net/weixin_69553582
?? 另,請尊重作者原創(chuàng)的不易,轉(zhuǎn)載請注明來源。代碼里請保留作者相關(guān)的版權(quán)信息。這些不會影響代碼展示效果。
二、草莓熊手持玫瑰花成品效果圖
?? 上次我畫草莓熊是手持風(fēng)車版的,這次我畫的草莓熊是手持玫瑰花的特別版,想送玫瑰花逗朋友開心的可以留意一下。
?? 如果你將草莓熊python動畫送給你朋友時,他(她)喜歡,請在心里悄悄告訴我一聲,讓我也跟著開心一下。生活不易,我希望自己的努力和付出能帶給別人真正的開心和快樂!雖然你我并不認(rèn)識,雖然逆境清醒已經(jīng)很笨,但我還是選擇堅持做個單純善良的人。
?來一張沒有底圖的,效果如下:
三、代碼演示方法和代碼命令解釋
?? 將源代碼完整拷貝,保存成:你的文件名.py? ?,然后在python環(huán)境下運行。你會看到和我一樣的草莓熊效果。
?? 代碼的語法解釋部分,可點擊查看文章里的介紹:草莓熊python turtle繪圖代碼
四、草莓熊手持的玫瑰花源代碼
?? 草莓熊手里的玫瑰花是我原創(chuàng)的玫瑰花,畫了好久。。。是多層立體玫瑰,效果如圖:
???? 請點擊查看:立體多層玫瑰繪圖源碼__玫瑰花python 繪圖源碼集錦
五、相關(guān)資源圖片
“草莓熊手持玫瑰花”效果圖里的底圖如下,需要的可以下載。保存成:ditu3.gif,放在草莓熊代碼的同一個目錄里。
如果你有自己喜歡的底圖,可以將第19行的? “#t.bgpic("ditu3.gif")”? 這句里的圖片文件名替換成你自己的圖片文件名,記得將注釋的#符號取消。
六、我的“草莓熊python turtle繪圖(玫瑰花版)”繪圖源代碼
#-*- coding: UTF-8 -*-
import turtle as t
"""
=================================================
@Project ->Adversity Awake 草莓熊系列
@類別 : 草莓熊->草莓熊之3
@Author : 逆境清醒
@Date : 2022/11/10 1:46
@Desc :https://blog.csdn.net/weixin_69553582
=================================================
"""
# 設(shè)置背景顏色,窗口位置以及大小
t.colormode(255)# 顏色模式
t.speed(0)
t.screensize(850,760,"white")#畫布大小背景顏色
t.setup(width=850, height=760,startx=None, starty=None) #繪圖窗口的大小和起始坐標(biāo)
#t.bgpic("ditu3.gif")
t.title("逆境清醒草莓熊!")#設(shè)置繪圖窗口的標(biāo)題
t.resizemode('noresize') #大小調(diào)整模式:auto,user,noresize
t.tracer(1)
def mlingpen(x, y):
t.penup()
t.goto(x, y)
t.pendown()
def rose(): #rose
t.seth(90)
mlingpen(-225, -60)
t.pensize(10)
t.pencolor("#035025")
t.circle(300,30)
mlingpen(-240, 70)
t.pensize(2)
t.color("#000000", "#22ac38")
t.seth(12)
mlingpen(-235,40)
t.lt(40)
t.fd(50)
t.begin_fill()
t.circle(-150,30)
t.circle(-2,140)
t.circle(-150,43)
t.up()
t.end_fill()
mlingpen(-235,40)
t.lt(330)
t.fd(50)
t.begin_fill()
t.circle(-150,30)
t.circle(-2,140)
t.circle(-150,43)
t.up()
t.end_fill()
mlingpen(-235,40)
t.lt(260)
t.fd(50)
t.begin_fill()
t.circle(-150,30)
t.circle(-2,140)
t.circle(-150,43)
t.up()
t.end_fill()
t.pensize(2)
t.seth(12)
mlingpen(-210,60)
t.begin_fill()
t.color("#000000", "#f8c0c8")
t.circle(50,150)
t.rt(20)
t.fd(40)
t.rt(40)
t.circle(15,130)
t.fd(50)
t.circle(15,80)
t.up()
t.end_fill()
t.pensize(2)
t.seth(12)
mlingpen(-210,65)
t.begin_fill()
t.color("#f5aab5", "#f5aab5")
t.circle(34,150)
t.rt(20)
t.fd(30)
t.rt(40)
t.circle(10,130)
t.fd(50)
t.circle(15,80)
t.up()
t.end_fill()
t.pensize(2)
t.seth(12)
mlingpen(-210,65)
t.begin_fill()
t.color("#f198a5", "#f198a5")
t.circle(30,150)
t.rt(20)
t.fd(30)
t.rt(40)
t.circle(10,130)
t.fd(50)
t.circle(15,80)
t.up()
t.end_fill()
t.pensize(2)
t.seth(12)
mlingpen(-210,65)
t.begin_fill()
t.color("#ee8998", "#ee8998")
t.circle(20,150)
t.rt(20)
t.fd(30)
t.rt(40)
t.circle(10,130)
t.fd(50)
t.circle(15,80)
t.up()
t.end_fill()
mlingpen(-220,80)
t.begin_fill()
t.color("#e56e7f", "#e56e7f")
t.circle(15,200)
t.rt(20)
t.fd(30)
t.rt(40)
t.circle(10,130)
t.fd(50)
t.circle(15,80)
t.up()
t.end_fill()
t.seth(35)
mlingpen(-230,90)
t.begin_fill()
t.color("#000000", "#fda7b5")
t.circle(50,50)
t.rt(40)
t.circle(25,200)
t.up()
t.end_fill()
t.seth(130)
mlingpen(-294.51,142.14)
t.begin_fill()
t.color("#000000", "#fdadb8")
t.circle(20,100)
t.rt(90)
t.circle(10,180)
t.rt(90)
t.circle(15,130)
t.rt(110)
t.circle(30,130)
t.rt(50)
t.circle(50,80)
t.up()
t.end_fill()
t.seth(80)
mlingpen(-240,140)
t.begin_fill()
t.color("#000000", "#fe8e9e")
t.circle(10,100)
t.rt(90)
t.circle(12,150)
t.rt(90)
t.circle(15,130)
t.rt(50)
t.circle(50,80)
t.rt(10)
t.circle(50,80)
t.goto(-240,140)
t.up()
t.end_fill()
t.seth(80)
mlingpen(-250,140)
t.begin_fill()
t.color("#f9788b", "#f9788b")
t.circle(5,130)
t.rt(90)
t.circle(10,170)
t.rt(100)
t.circle(10,130)
t.rt(70)
t.circle(40,80)
t.rt(40)
t.circle(30,30)
t.goto(-250,140)
t.up()
t.end_fill()
t.seth(10)
mlingpen(-245, 80)
t.begin_fill()
t.color("#000000", "#ef5f7a")
t.seth(35)
t.circle(30,80)
t.rt(80)
t.circle(10,150)
t.rt(80)
t.circle(17,200)
t.rt(60)
t.circle(29,120)
t.goto(-245, 80)
t.up()
t.end_fill()
t.seth(10)
mlingpen(-250, 85)
t.begin_fill()
t.color("#ef758c", "#ef758c")
t.seth(35)
t.circle(25,80)
t.rt(80)
t.circle(6,150)
t.rt(80)
t.circle(12,210)
t.rt(60)
t.circle(23,120)
t.goto(-250, 85)
t.up()
t.end_fill()
t.seth(0)
mlingpen(-250,125)
t.pensize(5)
t.dot("#ff4969")
t.pensize(2)
mlingpen(-266.97,121.26)
t.pencolor("#321320")
t.fillcolor("#f04969")
t.begin_fill()
t.rt(80)
t.circle(12,150)
t.rt(80)
t.circle(6,270)
t.rt(150)
t.circle(10,180)
t.up()
t.end_fill()
#t.color("#000000", "#f04969")
t.seth(-70)
mlingpen(-210,100)
t.begin_fill()
t.color("#000000", "#f04969")
t.rt(20)
t.fd(30)
t.circle(-40,170)
t.lt(20)
t.fd(20)
t.goto(-210,100)
t.up()
t.end_fill()
t.seth(-70)
mlingpen(-215,90)
t.begin_fill()
t.color("#ee627d", "#ee627d")
t.rt(20)
t.fd(20)
t.circle(-35,170)
t.lt(20)
t.fd(15)
t.goto(-220,90)
t.up()
t.end_fill()
t.seth(-70)
mlingpen(-220,80)
t.begin_fill()
t.color("#f47a91", "#f47a91")
t.rt(20)
t.fd(10)
t.circle(-28,170)
t.lt(20)
t.fd(10)
t.goto(-220,90)
t.up()
t.end_fill()
t.seth(150)
mlingpen(-220,100)
t.begin_fill()
t.color("#000000", "#f7cad1")
t.circle(20,80)
t.rt(10)
t.circle(-40,70)
t.rt(10)
t.circle(20,80)
t.rt(5)
t.circle(5,180)
t.rt(80)
t.circle(20,70)
t.rt(80)
t.circle(40,60)
t.rt(10)
t.circle(40,110)
t.goto(-220,100)
t.up()
t.end_fill()
t.seth(150)
mlingpen(-220,98)
t.begin_fill()
t.color("#ffe9f2", "#ffe9f2")
t.circle(15,80)
t.rt(7)
t.circle(-45,75)
t.rt(8)
t.circle(20,50)
t.rt(5)
t.circle(2,200)
t.rt(80)
t.circle(15,85)
t.rt(80)
t.circle(40,60)
t.rt(20)
t.circle(30,70)
t.goto(-220,98)
t.up()
t.end_fill()
t.seth(150)
mlingpen(-180,55)
t.begin_fill()
t.color("#000000", "#f7cad1")
t.circle(30,80)
t.rt(10)
t.circle(-60,70)
t.rt(5)
t.circle(30,80)
t.rt(5)
t.circle(5,180)
t.rt(90)
t.circle(30,80)
t.rt(80)
t.circle(40,70)
t.circle(20,50)
t.rt(90)
t.circle(20,95)
t.goto(-180,55)
t.up()
t.end_fill()
t.seth(150)
mlingpen(-190,50)
t.begin_fill()
t.color("#f7e0e3", "#f7e0e3")
t.circle(25,80)
t.rt(8)
t.circle(-55,75)
t.rt(3)
t.circle(25,60)
t.rt(6)
t.circle(5,200)
t.rt(90)
t.circle(30,80)
t.rt(80)
t.circle(22,80)
t.circle(20,40)
t.rt(80)
t.circle(15,90)
t.goto(-190,50)
t.up()
t.end_fill()
mling_circle_list = iter([ # 每段弧線(半徑,弧角度數(shù))
(18, 360), (14, 360), (10, 360), (6, 360),
(18, 360), (14, 360), (10, 360), (6, 360),
])
def mling_draw_eyeball(zb1,zb2,zb3,zb4):
for zb, color_ in zip([zb1,zb2,zb3,zb4], ['#ffffff', '#482d08', '#000000', '#ffffff']):
t.penup()
t.goto(*zb)
t.pendown()
t.begin_fill()
t.setheading(0)
t.color(color_)
t.pencolor('#000000')
t.pensize(2)
t.circle(*next(mling_circle_list))
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#cb3263")
t.pensize(4)
t.goto(120,110)
t.pendown()
t.begin_fill()
t.goto(200,0)
t.left(-40)
t.circle(-110,105)
t.left(75)
t.goto(170,-110)
t.left(-80)
t.circle(30,40)
t.left(60)
t.circle(-80,70)
t.left(83)
t.circle(-35,95)
t.goto(60,-270)
t.left(-80)
t.circle(-65,70)
t.left(63)
t.circle(35,30)
t.left(130)
t.circle(-65,70)
t.goto(-120,-270)
t.left(-110)
t.circle(-35,80)
t.left(83)
t.circle(-80,50)
t.left(60)
t.circle(-80,60)
t.left(60)
t.circle(30,30)
t.left(20)
t.circle(80,80)
t.left(-105)
t.circle(-70,150)
t.left(50)
t.circle(-170,50)
t.goto(120,110)
#Author:Adversity Awake
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#ffffff")
t.pensize(4)
t.goto(90,60)
t.pendown()
t.begin_fill()
t.right(30)
t.circle(-130,360)
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
#t.fillcolor("#f3d2ad")
t.fillcolor("#015426")
t.pensize(4)
t.goto(-250,-55)
t.dot("blue")
t.seth(0)
t.pendown()
t.begin_fill()
t.right(-55)
#t.circle(-45,270)
t.circle(-35,70)
t.goto(-200,-165)
t.goto(-250,-165)
t.goto(-220,-75)
t.goto(-250,-55)
t.end_fill()
rose()
t.penup()
p = t.home()
t.pencolor("#321320")
#t.fillcolor("#f3d2ad")
t.fillcolor("#f3d2ad")
t.pensize(4)
t.goto(185,-90)
t.pendown()
t.begin_fill()
t.right(140)
t.circle(43,95)
t.goto(185,-90)
t.end_fill()
t.penup()
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#cb3263')
t.pensize(4)
t.begin_fill()
t.goto(21,0)
t.pendown()
t.circle(123,134)
t.left(-90)
t.circle(40,185)
t.left(-60)
t.circle(120,60)
t.left(-90)
t.circle(50,200)
t.left(-90)
t.circle(100,100)
t.left(-12)
t.circle(100,40)
t.goto(21,0)
t.penup()
#Author:Adversity Awake
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.goto(-70,210)
t.left(140)
t.pendown()
t.circle(30,200)
t.goto(-70,210)
t.penup()
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.goto(90,220)
t.left(45)
t.pendown()
t.circle(22,200)
t.goto(90,220)
t.penup()
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.left(-98)
t.left(90)
t.goto(18,10)
t.pendown()
t.circle(100,134)
t.left(10)
t.circle(110,30)
t.left(10)
t.circle(160,40)
t.circle(85,40)
t.left(2)
t.circle(95,40)
t.left(5)
t.circle(95,60)
t.goto(18,10)
t.penup()
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(2)
t.goto(25,240)
t.pendown()
t.begin_fill()
t.goto(60,235)
t.left(30)
t.fd(8)
t.left(90)
t.fd(22)
t.circle(90, 8)
t.left(20)
t.circle(90, 8)
t.left(20)
t.circle(90, 20)
t.left(40)
t.circle(50, 20)
t.end_fill()
t.penup()
t.pensize(12)
t.goto(-2,250)
t.pencolor("#4D1F00")
t.fillcolor("#4D1F00")
t.pendown()
t.goto(60,240)
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(2)
t.goto(-55,193)
t.pendown()
t.begin_fill()
t.left(65)
t.circle(-90, 25)
t.goto(-10,230)
t.left(30)
t.fd(8)
t.left(90)
t.fd(18)
t.circle(90, 8)
t.left(20)
t.circle(90, 10)
t.left(40)
t.circle(90, 30)
t.left(30)
t.circle(40, 20)
t.penup()
t.end_fill()
t.pensize(12)
t.goto(-63,195)
t.pencolor("#4D1F00")
t.fillcolor("#4D1F00")
t.pendown()
t.left(100)
t.circle(-85,45)
t.end_fill()
mling_draw_eyeball((-20,180), (-23,185), (-25,188), (-30,200))
mling_draw_eyeball((30, 193), (27, 200), (25,203), (20,213))
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(3)
t.goto(25,105)
p = t.pos()
t.pendown()
t.begin_fill()
t.circle(85, 65)
t.left(16)
t.circle(30, 55)
t.left(20)
t.circle(145, 58)
t.left(8)
t.circle(20, 55)
t.left(8)
t.circle(50, 65)
t.left(-5)
t.circle(310, 8)
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#a93e54')
t.pensize(3)
t.begin_fill()
t.left(-20)
t.goto(9,66)
t.pendown()
t.circle(68,40)
t.left(10)
t.circle(65,40)
t.left(160)
t.circle(-75,85)
t.left(158)
t.circle(48,37)
t.goto(9,66)
t.penup()
t.end_fill()
t.color('#987824')
t.penup()
t.goto(260,60)
t.pendown()
t.write("愿\n你\n沒\n有\(zhòng)n煩\n惱\n",align="center",font=("黑體",20,"normal"))
t.penup()
t.goto(290,183)
t.pendown()
t.write("逆\n境\n清\n醒\n",align="center",font=("黑體",10,"normal"))
t.hideturtle()
t.done()
七、草莓熊python turtle繪圖(風(fēng)車版)附源代碼
詳細(xì)請點擊查看:草莓熊python turtle繪圖(風(fēng)車版)附源代碼
八、怎么才能正常運行python turtle繪圖代碼(本機運行、打包發(fā)給別人)
怎么才能正常運行python turtle繪圖代碼
(1)本機運行繪圖代碼
(2)打包發(fā)給別人欣賞python動畫
? ? ? (a)安裝Pyinstaller
? ? ? (b)用Pyinstaller打包動畫文件
Pyinstaller參數(shù)詳解
(1)可選參數(shù)
(2)、與生成結(jié)果有關(guān)的參數(shù)
(3)、指定打包哪些資源、代碼
(4)、生成參數(shù)
(5)、Windows 和 Mac OS X 特定選項
(6)、Windows特有的參數(shù)
? 具體的詳細(xì)介紹寫在此文中,請點擊查看:巴斯光年python turtle繪圖__附源代碼
?
?
九、?草莓熊python turtle繪圖(圣誕元旦倒數(shù)雪花版)附源代碼?草莓熊python繪圖(春節(jié)版,圣誕倒數(shù)雪花版)附源代碼
?點擊查看:
?草莓熊python繪圖(春節(jié)版,圣誕倒數(shù)雪花版)附源代碼
???推薦閱讀:
![]() |
原創(chuàng)唯美浪漫情人節(jié)表白專輯,(復(fù)制就可用)(html5,css3,svg)更好的向你所喜歡的人表達(dá)內(nèi)心的感受。 |
|
|
2023年春節(jié)祝福第二彈——送你一只守護兔,讓它溫暖每一個你【html5 css3】畫會動的小兔子 | |
25 | ? |
2023春節(jié)祝福系列第一彈(放飛祈??酌鳠?,祝福大家身體健康)(附完整源代碼及資源免費下載) |
24 |
|
HTML+CSS+svg繪制精美彩色閃燈圣誕樹,HTML+CSS+Js實時新年時間倒數(shù)倒計時(附源代碼) |
23 |
|
?草莓熊python繪圖(春節(jié)版,圣誕倒數(shù)雪花版)附源代碼 |
22 |
|
【程序人生】卡塔爾世界杯元素python海龜繪圖(附源代碼),世界杯主題前端特效5個(附源碼) |
21 |
?? |
python愛心源代碼集錦 |
20 |
?? |
巴斯光年python turtle繪圖__附源代碼 |
19 |
??? |
Three.js實例詳解___旋轉(zhuǎn)的精靈女孩(附完整代碼和資源) |
18 |
????文章來源:http://www.zghlxwxcb.cn/news/detail-785776.html |
?草莓熊python turtle繪圖(玫瑰花版)附源代碼 |
17 |
???? |
立體多層玫瑰繪圖源碼__玫瑰花python 繪圖源碼集錦 |
16 |
???? |
皮卡丘python turtle海龜繪圖(電力球版)附源代碼 |
15 |
???? |
【CSDN云IDE】個人使用體驗和建議(含超詳細(xì)操作教程)(python、webGL方向) |
14 |
???? |
草莓熊python turtle繪圖(風(fēng)車版)附源代碼 |
13 |
???? |
用代碼過中秋,python海龜月餅?zāi)阋灰獓L一口? |
12 |
???? |
《 Python List 列表全實例詳解系列》__系列總目錄 |
11 |
???? |
用代碼寫出浪漫__合集(python、matplotlib、Matlab、java繪制愛心、玫瑰花、前端特效玫瑰、愛心) |
10 |
???? |
Python函數(shù)方法實例詳解全集(更新中...) |
9 |
???? |
matplotlib 自帶繪圖樣式效果展示速查(28種,全) |
8 |
???? |
手機屏幕壞了____怎么把里面的資料導(dǎo)出(18種方法) |
7 |
???? |
2023年1月多家權(quán)威機構(gòu)____編程語言排行榜__薪酬狀況 |
6 |
???? |
Python中Print()函數(shù)的用法___實例詳解(全,例多) |
5 |
???? |
色彩顏色對照表(300種顏色)(16進制、RGB、CMYK、HSV、中英文名) |
4 |
???? |
Node.js (v19.1.0npm 8.19.3) vue.js安裝配置教程(超詳細(xì)) |
3 |
???? |
Tomcat 啟動閃退問題解決集(八大類詳細(xì)) |
2 |
???? |
Tomcat端口配置(詳細(xì)) |
1 |
???? |
Tomcat10 安裝(Windows環(huán)境)(詳細(xì))文章來源地址http://www.zghlxwxcb.cn/news/detail-785776.html |
到了這里,關(guān)于?草莓熊python turtle繪圖代碼(玫瑰花版)附源代碼的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!