這是借鑒了一位兄弟的代碼,然后進(jìn)行修改的,原來(lái)代碼存在問(wèn)題,用了2小時(shí),自己修改,終于畫(huà)出了滑稽臉,也算是對(duì)于今天學(xué)的turtle繪畫(huà)庫(kù)的一個(gè)小小的記錄吧?。ㄓ绣e(cuò)誤希望各位看官指正啊)
創(chuàng)新互聯(lián)建站-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比臨夏州網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式臨夏州網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋臨夏州地區(qū)。費(fèi)用合理售后完善,10余年實(shí)體公司更值得信賴。編譯器是:Atom
python 是3.7版本
運(yùn)行位 Windows power shell
import turtle turtle.setup(600,600,200,200) #fcae turtle.penup() turtle.goto(-210,0) turtle.seth(-90) turtle.pendown() turtle.pencolor(‘orange') turtle.pensize(4) turtle.begin_fill() turtle.circle(210,360) turtle.fillcolor(‘yellow') turtle.end_fill() turtle.pencolor(‘black') #mouth turtle.pensize(5) turtle.penup() turtle.goto(-150,30) turtle.pendown() turtle.seth(-90) turtle.circle(150,180) #left eye turtle.penup() turtle.pensize(4) turtle.goto(-180,90) turtle.pendown() turtle.seth(40) turtle.begin_fill() turtle.circle(-120,80) turtle.penup() turtle.goto(-180,90) turtle.pendown() turtle.seth(-130) turtle.circle(15,110) turtle.seth(40) turtle.circle(-106,83) turtle.seth(30) turtle.circle(18,105) turtle.fillcolor(‘white') turtle.end_fill() #right eye turtle.penup() turtle.goto(20,90) turtle.pendown() turtle.seth(40) turtle.begin_fill() turtle.circle(-120,80) turtle.penup() turtle.goto(20,90) turtle.pendown() turtle.seth(-130) turtle.circle(15,110) turtle.seth(40) turtle.circle(-106,83) turtle.seth(30) turtle.circle(18,105) turtle.fillcolor(‘white') turtle.end_fill() #Eyeball turtle.pensize(2) turtle.penup() turtle.goto(50,95) turtle.pendown() turtle.begin_fill() turtle.circle(8,360) turtle.fillcolor(‘black') turtle.end_fill() turtle.penup() turtle.goto(-150,95) turtle.pendown() turtle.begin_fill() turtle.circle(8,360) turtle.fillcolor(‘black') turtle.end_fill() #Blush turtle.pensize(1) turtle.pencolor(‘pink') turtle.begin_fill() turtle.penup() turtle.goto(-160,50) turtle.pendown() turtle.seth(-90) for i in range(2): for j in range(10): turtle.forward(j) turtle.left(9) for j in range(10,0,-1): turtle.forward(j) turtle.left(9) turtle.fillcolor(‘pink') turtle.end_fill() turtle.pensize(1) turtle.pencolor(‘pink') turtle.begin_fill() turtle.penup() turtle.goto(40,50) turtle.pendown() turtle.seth(-90) for i in range(2): for j in range(10): turtle.forward(j) turtle.left(9) for j in range(10,0,-1): turtle.forward(j) turtle.left(9) turtle.fillcolor(‘pink') turtle.end_fill() turtle.hideturtle() turtle.done()
分享文章:使用python的turtle繪畫(huà)滑稽臉實(shí)例-創(chuàng)新互聯(lián)
當(dāng)前URL:http://jinyejixie.com/article38/coehpp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、網(wǎng)站制作、靜態(tài)網(wǎng)站、服務(wù)器托管、網(wǎng)站內(nèi)鏈、建站公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容