Python+Turtle繪制可愛的多啦A夢的示例代碼
1 送她的多啦A夢
一個哆啦A夢讓她開心開心好久好久。我也很開心,昨天送了一個實體模型,今天用Python代碼再弄一個送給她。

哆啦A夢(日語:ドラえもん,英語:Doraemon),舊譯為機器貓,日本漫畫《多啦A夢》及其衍生作品中的貓型機器人,本作的主人公。名字的意思是銅鑼(ドラ)衛(wèi)門(えもん)。
哆啦A夢肚子上擁有四次元口袋,這個口袋直接通往四次元空間,再多的東西也放得下。害怕老鼠。平時的職責是照顧野比大雄。

2 白駒過隙
雖說雁過無痕,歲月無聲,而白駒過隙的光陰卻在生命的每個角落不著痕跡的流,總是蕩漾在我渺遠的心跡,很懷念。讓它停留在記憶的沙灘上,混入蚌中,化作一顆最美的珍珠.....
她的光環(huán)
天空很蔚藍也是你的主色
我送你的紅禮巾系著金色鈴鐺
最后的擁抱你像棉花糖一樣樣的柔軟哆啦A夢
請把我最珍貴的東西
都裝進你的百寶袋
3 Python代碼實現(xiàn)

import turtle as t
# t.speed(3)
t.title('我的小公主,哆啦A夢')
t.pensize(8)
t.hideturtle()
t.screensize(500, 500, bg='white')
#========貓臉========
t.fillcolor('#00A1E8')
t.begin_fill()
t.circle(120)
t.end_fill()
t.pensize(3)
t.fillcolor('white')
t.begin_fill()
t.circle(100)
t.end_fill()
t.pu()
t.home()
t.goto(0, 134)
t.pd()
t.pensize(4)
t.fillcolor("#EA0014")
t.begin_fill()
t.circle(18)
t.end_fill()
t.pu()
t.goto(7, 155)
t.pensize(2)
t.color('white', 'white')
t.pd()
t.begin_fill()
t.circle(4)
t.end_fill()
t.pu()
t.goto(-30, 160)
t.pensize(4)
t.pd()
t.color('black', 'white')
t.begin_fill()
a = 0.4
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a = a + 0.08
t.lt(3) # 向左轉(zhuǎn)3度
t.fd(a) # 向前走a的步長
else:
a = a - 0.08
t.lt(3)
t.fd(a)
t.end_fill()
t.pu()
t.goto(30, 160)
t.pensize(4)
t.pd()
t.color('black', 'white')
t.begin_fill()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a = a + 0.08
t.lt(3) # 向左轉(zhuǎn)3度
t.fd(a) # 向前走a的步長
else:
a = a - 0.08
t.lt(3)
t.fd(a)
t.end_fill()
t.pu()
t.goto(-38, 190)
t.pensize(8)
t.pd()
t.right(-30)
t.forward(15)
t.right(70)
t.forward(15)
t.pu()
t.goto(15, 185)
t.pensize(4)
t.pd()
t.color('black', 'black')
t.begin_fill()
t.circle(13)
t.end_fill()
t.pu()
t.goto(13, 190)
t.pensize(2)
t.pd()
t.color('white', 'white')
t.begin_fill()
t.circle(5)
t.end_fill()
t.pu()
t.home()
t.goto(0, 134)
t.pensize(4)
t.pencolor('black')
t.pd()
t.right(90)
t.forward(40)
t.pu()
t.home()
t.goto(0, 124)
t.pensize(3)
t.pencolor('black')
t.pd()
t.left(10)
t.forward(80)
t.pu()
t.home()
t.goto(0, 114)
t.pensize(3)
t.pencolor('black')
t.pd()
t.left(6)
t.forward(80)
t.pu()
t.home()
t.goto(0, 104)
t.pensize(3)
t.pencolor('black')
t.pd()
t.left(0)
t.forward(80)
#====左邊的胡子====
t.pu()
t.home()
t.goto(0, 124)
t.pensize(3)
t.pencolor('black')
t.pd()
t.left(170)
t.forward(80)
t.pu()
t.home()
t.goto(0, 114)
t.pensize(3)
t.pencolor('black')
t.pd()
t.left(174)
t.forward(80)
t.pu()
t.home()
t.goto(0, 104)
t.pensize(3)
t.pencolor('black')
t.pd()
t.left(180)
t.forward(80)
t.pu()
t.goto(-70, 70)
t.pd()
t.color('black', 'red')
t.pensize(6)
t.seth(-60)
t.begin_fill()
t.circle(80, 40)
t.circle(80, 80)
t.end_fill()
t.pu()
t.home()
t.goto(-80, 70)
t.pd()
t.forward(160)
t.pu()
t.home()
t.goto(-50, 50)
t.pd()
t.pensize(1)
t.fillcolor("#eb6e1a")
t.seth(40)
t.begin_fill()
t.circle(-40, 40)
t.circle(-40, 40)
t.seth(40)
t.circle(-40, 40)
t.circle(-40, 40)
t.seth(220)
t.circle(-80, 40)
t.circle(-80, 40)
t.end_fill()
#====領(lǐng)帶=====
t.pu()
t.goto(-70, 12)
t.pensize(14)
t.pencolor('red')
t.pd()
t.seth(-20)
t.circle(200, 30)
t.circle(200, 10)
#====鈴鐺=====
t.pu()
t.goto(0, -46)
t.pd()
t.pensize(3)
t.color("black", '#f8d102')
t.begin_fill()
t.circle(25)
t.end_fill()
t.pu()
t.goto(-5, -40)
t.pd()
t.pensize(2)
t.color("black", '#79675d')
t.begin_fill()
t.circle(5)
t.end_fill()
t.pensize(3)
t.right(115)
t.forward(7)
t.mainloop()到此這篇關(guān)于Python+Turtle繪制可愛的多啦A夢的示例代碼的文章就介紹到這了,更多相關(guān)Python Turtle多啦A夢內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Python實現(xiàn)提取谷歌音樂搜索結(jié)果的方法
這篇文章主要介紹了Python實現(xiàn)提取谷歌音樂搜索結(jié)果的方法,涉及Python針對谷歌音樂相關(guān)信息的獲取技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-07-07
Python如何使用pymongo連接MongoDB數(shù)據(jù)庫并進行相關(guān)操作
PyMongo是驅(qū)動程序,使python程序能夠使用Mongodb數(shù)據(jù)庫,使用python編寫而成,下面這篇文章主要給大家介紹了關(guān)于Python如何使用pymongo連接MongoDB數(shù)據(jù)庫并進行相關(guān)操作的相關(guān)資料,需要的朋友可以參考下2023-05-05
postman發(fā)送文件請求并以python服務(wù)接收方式
這篇文章主要介紹了postman發(fā)送文件請求并以python服務(wù)接收方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-07-07
使用Python和百度語音識別生成視頻字幕的實現(xiàn)
這篇文章主要介紹了使用Python和百度語音識別生成視頻字幕,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-04-04
python3+telnetlib實現(xiàn)簡單自動測試示例詳解
telnetlib 模塊提供一個實現(xiàn)Telnet協(xié)議的類 Telnet,本文重點給大家介紹python3+telnetlib實現(xiàn)簡單自動測試示例詳解,需要的朋友可以參考下2021-08-08
django 快速啟動數(shù)據(jù)庫客戶端程序的方法示例
這篇文章主要介紹了django 快速啟動數(shù)據(jù)庫客戶端程序的方法示例,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2019-08-08

