欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

用python畫(huà)一只可愛(ài)的皮卡丘實(shí)例

 更新時(shí)間:2019年11月21日 10:59:36   作者:隔壁鄭同學(xué)  
今天小編就為大家分享一篇用python畫(huà)一只可愛(ài)的皮卡丘實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧

效果圖

#!/usr/bin/env python 
# -*- coding:utf-8 -*-
from turtle import *
'''
繪制皮卡丘頭部
'''
def face(x,y):
 """畫(huà)臉"""
 begin_fill()
 penup()
 # 將海龜移動(dòng)到指定的坐標(biāo)
 goto(x, y)
 pendown()
 # 設(shè)置海龜?shù)姆较?
 setheading(40)

 circle(-150, 69)
 fillcolor("#FBD624")
 # 將海龜移動(dòng)到指定的坐標(biāo)
 
 penup()
 goto(53.14, 113.29)
 pendown()
 
 setheading(300)
 circle(-150, 30)
 setheading(295)
 circle(-140, 20)
 print(position())
 forward(5)
 setheading(260)
 circle(-80, 70)
 print(position())
 penup()
 goto(-74.43,-79.09)
 pendown()


 penup()
 # 將海龜移動(dòng)到指定的坐標(biāo)
 goto(-144,103)
 pendown()
 setheading(242)
 circle(110, 35)
 right(10)
 forward(10)
 setheading(250)
 circle(80, 115)
 print(position())

 penup()
 goto(-74.43,-79.09)
 pendown()
 setheading(10)
 penup()
 goto(-144, 103)

 pendown()
 penup()
 goto(x, y)
 pendown()


 end_fill()

 # 下巴
 penup()
 goto(-50, -82.09)
 pendown()
 pencolor("#DDA120")
 fillcolor("#DDA120")
 begin_fill()
 setheading(-12)
 circle(120, 25)
 setheading(-145)
 forward(30)
 setheading(180)
 circle(-20, 20)
 setheading(143)
 forward(30)
 end_fill()
 # penup()
 # # 將海龜移動(dòng)到指定的坐標(biāo)
 # goto(0, 0)
 # pendown()

def eye():
 """畫(huà)眼睛"""
 # 左眼
 color("black","black")
 penup()
 goto(-110, 27)
 pendown()
 begin_fill()
 setheading(0)
 circle(24)
 end_fill()
 # 左眼仁
 color("white", "white")
 penup()
 goto(-105, 51)
 pendown()
 begin_fill()
 setheading(0)
 circle(10)
 end_fill()
 # 右眼
 color("black", "black")
 penup()
 goto(25, 40)
 pendown()
 begin_fill()
 setheading(0)
 circle(24)
 end_fill()
 # 右眼仁
 color("white", "white")
 penup()
 goto(17, 62)
 pendown()
 begin_fill()
 setheading(0)
 circle(10)
 end_fill()
def cheek():
 """畫(huà)臉頰"""
 # 右邊
 color("#9E4406", "#FE2C21")
 penup()
 goto(-130, -50)
 pendown()
 begin_fill()
 setheading(0)
 circle(27)
 end_fill()

 # 左邊
 color("#9E4406", "#FE2C21")
 penup()
 goto(53, -20)
 pendown()
 begin_fill()
 setheading(0)
 circle(27)
 end_fill()


def nose():
 """畫(huà)鼻子"""
 color("black", "black")
 penup()
 goto(-40, 38)
 pendown()
 begin_fill()
 circle(7,steps = 3)
 end_fill()
def mouth():
 """畫(huà)嘴"""
 color("black", "#F35590")
 # 嘴唇
 penup()
 goto(-10, 22)
 pendown()
 begin_fill()
 setheading(260)
 forward(60)
 circle(-11, 150)
 forward(55)
 print(position())
 penup()
 goto(-38.46, 21.97)
 pendown()
 end_fill()

 # 舌頭
 color("#6A070D", "#6A070D")
 begin_fill()
 penup()
 goto(-10.00, 22.00)
 pendown()
 penup()
 goto(-14.29, -1.7)
 pendown()
 penup()
 goto(-52, -5)
 pendown()
 penup()
 goto(-60.40, 12.74)
 pendown()
 penup()
 goto(-38.46, 21.97)
 pendown()
 penup()
 goto(-10.00, 22.00)
 pendown()

 end_fill()

 color("black","#FFD624")

 penup()
 goto(-78, 15)
 pendown()
 begin_fill()
 setheading(-25)
 for i in range(2):
  setheading(-25)
  circle(35, 70)

 end_fill()
 color("#AB1945", "#AB1945")
 penup()
 goto(-52, -5)
 pendown()
 begin_fill()
 setheading(40)
 circle(-33, 70)
 goto(-16,-1.7)
 penup()
 goto(-18,-17)
 pendown()
 setheading(155)
 circle(25, 70)
 end_fill()


def ear():
 """畫(huà)耳朵"""
 # 左耳
 color("black","#FFD624")
 penup()
 goto(-145, 93)
 pendown()
 begin_fill()
 setheading(165)
 circle(-248,50)
 right(120)
 circle(-248,50)
 end_fill()
 color("black", "black")
 penup()
 goto(-240, 143)
 pendown()
 begin_fill()
 setheading(107)
 circle(-170, 25)
 left(80)
 circle(229, 15)
 left(120)
 circle(300, 15)
 end_fill()

 # 右耳
 color("black", "#FFD624")
 penup()
 goto(30, 136)
 pendown()
 begin_fill()
 setheading(64)
 circle(-248, 50)

 right(120)
 circle(-248, 50)
 end_fill()
 color("black", "black")
 penup()
 goto(160, 200)
 pendown()
 begin_fill()
 setheading(52)
 circle(170, 25)
 left(116)
 circle(229, 15)
 left(71)
 circle(-300, 15)
 end_fill()
 def setting():
 """設(shè)置參數(shù)"""
 pensize(2)
 # 隱藏海龜
 hideturtle()
 speed(10)
def main():
 """主函數(shù)"""
 setting()
 face(-132,115)
 eye()
 cheek()
 nose()
 mouth()
 ear()
 done()

if __name__ == '__main__':
 main()

以上這篇用python畫(huà)一只可愛(ài)的皮卡丘實(shí)例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

您可能感興趣的文章:

相關(guān)文章

  • Python標(biāo)準(zhǔn)庫(kù)之Sys模塊使用詳解

    Python標(biāo)準(zhǔn)庫(kù)之Sys模塊使用詳解

    這篇文章主要介紹了Python標(biāo)準(zhǔn)庫(kù)之Sys模塊使用詳解,本文講解了使用sys模塊獲得腳本的參數(shù)、處理模塊、使用sys模塊操作模塊搜索路徑、使用sys模塊查找內(nèi)建模塊、使用sys模塊查找已導(dǎo)入的模塊等使用案例,需要的朋友可以參考下
    2015-05-05
  • 如何用Python徒手寫(xiě)線性回歸

    如何用Python徒手寫(xiě)線性回歸

    這篇文章主要介紹了如何用Python徒手寫(xiě)線性回歸,幫助大家更好的理解和使用python,感興趣的朋友可以了解下
    2021-01-01
  • Python可變參數(shù)用法實(shí)例分析

    Python可變參數(shù)用法實(shí)例分析

    這篇文章主要介紹了Python可變參數(shù)用法,結(jié)合實(shí)例形式分析了Python可變參數(shù)的具體定義、使用方法與相關(guān)注意事項(xiàng),需要的朋友可以參考下
    2017-04-04
  • Python tkinter庫(kù)實(shí)現(xiàn)登錄注冊(cè)基本功能

    Python tkinter庫(kù)實(shí)現(xiàn)登錄注冊(cè)基本功能

    Python自帶了tkinter模塊,實(shí)質(zhì)上是一種流行的面向?qū)ο蟮腉UI工具包 TK 的Python編程接口,提供了快速便利地創(chuàng)建GUI應(yīng)用程序的方法,下面這篇文章主要給大家介紹了關(guān)于tkinter庫(kù)制作一個(gè)簡(jiǎn)單的登錄注冊(cè)小程序,需要的朋友可以參考下
    2022-12-12
  • Python實(shí)現(xiàn)圖像添加水印的方法

    Python實(shí)現(xiàn)圖像添加水印的方法

    在日常圖像處理中,為圖片添加水印是一項(xiàng)常見(jiàn)任務(wù),本文主要介紹了Python實(shí)現(xiàn)圖像添加水印的方法,具有一定的參考價(jià)值,感興趣的可以了解一下
    2024-07-07
  • wxPython實(shí)現(xiàn)整點(diǎn)報(bào)時(shí)

    wxPython實(shí)現(xiàn)整點(diǎn)報(bào)時(shí)

    這篇文章主要為大家詳細(xì)介紹了wxPython實(shí)現(xiàn)整點(diǎn)報(bào)時(shí),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-11-11
  • 對(duì)django中render()與render_to_response()的區(qū)別詳解

    對(duì)django中render()與render_to_response()的區(qū)別詳解

    今天小編就為大家分享一篇對(duì)django中render()與render_to_response()的區(qū)別詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-10-10
  • 100 個(gè) Python 小例子(練習(xí)題三)

    100 個(gè) Python 小例子(練習(xí)題三)

    這篇文章主要給大家分享的是100 個(gè) Python 小例子,前期已經(jīng)給大家分過(guò)100個(gè)小例子的(一)和(二),今天小編繼續(xù)和大家分享(三),希望歲正在學(xué)習(xí)的你有所幫助
    2022-01-01
  • Python實(shí)現(xiàn)批量識(shí)別銀行卡號(hào)碼以及自動(dòng)寫(xiě)入Excel表格步驟詳解

    Python實(shí)現(xiàn)批量識(shí)別銀行卡號(hào)碼以及自動(dòng)寫(xiě)入Excel表格步驟詳解

    這篇文章主要介紹了使用Python實(shí)現(xiàn)高效摸魚(yú),批量識(shí)別銀行卡號(hào)碼并且自動(dòng)寫(xiě)入Excel表格,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧
    2023-01-01
  • python如何安裝下載后的模塊

    python如何安裝下載后的模塊

    在本篇文章里小編給大家整理了關(guān)于python安裝下載后的模塊的方法,需要的朋友們可以學(xué)習(xí)下。
    2020-07-07

最新評(píng)論