最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

用python畫的蠟筆小新

2019-07-25 10:40 作者:這個騷年很可耐  | 我要投稿

代碼內(nèi)容如下:

這里要導入一個turtle庫,關于此庫的函數(shù)用法在本站的北京理工大學嵩天老師python課程的第二章里有所介紹,在此不一一贅述。

import turtle as t

t.setup(650,300,200,200)

t.pu()

t.fd(250)

t.seth(90)

t.pd()

t.pensize(10)

t.pencolor('black')

#臉部輪廓

t.begin_fill()

t.color('moccasin')

t.circle(200,180)

t.seth(-180)

t.circle(100,180)

t.fd(50)

t.circle(500,40)


#畫耳朵

t.seth(-90)

t.circle(55,45)

t.seth(90)

t.seth(30)

t.fd(45)

t.seth(360)

t.circle(55,255)

t.end_fill()

#畫嘴巴

t.pu()

t.goto(-120,-100)

t.pensize(1)

t.begin_fill()

t.color('red')

t.circle(35,360)

t.end_fill()

#畫左眼

t.goto(-75,50)

t.begin_fill()

t.color('black')

t.pd()

t.circle(35,360)

t.end_fill()


#畫左眼眼白

t.goto(-65,50)

t.begin_fill()

t.color('white')

t.circle(16.5,360)

t.end_fill()


#右眼

t.pu()

t.goto(45,50)

t.begin_fill()

t.color('black')

t.pd()

t.circle(35,360)

t.end_fill()


#畫右眼眼白

t.goto(55,50)

t.begin_fill()

t.color('white')

t.circle(16.5,360)

t.end_fill()


#畫眉毛

t.pu()

t.seth(90)

t.goto(5,70)

t.pensize(1)

t.pencolor('black')

t.pd()

t.circle(45,180)


t.pu()

t.seth(90)

t.goto(5,110)

t.pensize(15)

t.pencolor('black')

t.pd()

t.circle(45,180)


t.pu()

t.seth(90)

t.goto(125,70)

t.pensize(1)

t.pencolor('black')

t.pd()

t.circle(45,180)


t.pu()

t.seth(90)

t.goto(125,110)

t.pensize(15)

t.pencolor('black')

t.pd()

t.circle(45,180)


#畫頭發(fā)

t.pu()

t.goto(255,25)

t.seth(90)

t.pd()

t.pensize(10)

t.begin_fill()

t.color('black')

t.circle(200,120)

t.seth(-15)

t.fd(280)

t.seth(-90)

t.fd(100)

t.seth(360)

t.fd(25)

t.end_fill()

個人感覺還是有所欠缺,因此還希望大佬多多指正!

用python畫的蠟筆小新的評論 (共 條)

分享到微博請遵守國家法律
霍山县| 宕昌县| 万全县| 锡林郭勒盟| 乾安县| 天全县| 玉屏| 玉环县| 大港区| 绍兴县| 卓尼县| 二连浩特市| 桂平市| 安国市| 凉城县| 安义县| 八宿县| 双柏县| 红原县| 兴安盟| 兴化市| 雅江县| 遂平县| 金川县| 延吉市| 普宁市| 安化县| 荥经县| 桦南县| 莒南县| 大余县| 安宁市| 南雄市| 望奎县| 莱西市| 诸城市| 沅陵县| 铁力市| 太仆寺旗| 汽车| 海丰县|