日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > python >内容正文

python

python龟图_python学习turtle(龟图标状态)

發(fā)布時(shí)間:2023/12/20 python 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python龟图_python学习turtle(龟图标状态) 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

記錄學(xué)習(xí)

turtle.hideturtle()

turtle.ht(),隱藏龜圖標(biāo)。

turtle.showturtle()

turtle.st(),顯示龜圖標(biāo)。

turtle.isvisible(),龜是否顯示。顯示返回true,否則返回false。

turtle.shape(name=None),返回或設(shè)置形狀,最初有以下形狀:“arrow”, “turtle”, “circle”, “square”, “triangle”, “classic”。

turtle.resizemode(rmode=None),返回或設(shè)置龜形狀狀態(tài)。

“auto”:調(diào)整對(duì)應(yīng)于pensize值的烏龜?shù)耐庥^。跟隨pensize變化大小。

“user”:根據(jù)stretchfactor和outlinewidth(outline)的值來(lái)調(diào)整烏龜?shù)耐庥^。shapesize()與參數(shù)一起使用時(shí)調(diào)用resizemode(“user”)

“noresize”:沒(méi)有改變?yōu)觚數(shù)耐庥^。

turtle.shapesize(stretch_wid=None,?stretch_len=None,?outline=None)

turtle.turtlesize(stretch_wid=None,?stretch_len=None,?outline=None),返回或者設(shè)置形狀拉伸大小和輪廓線。

stretch_wid是垂直方向拉伸,stretch_len水平方向拉伸,outline輪廓的寬度。

初始形狀

運(yùn)行,turtle.shapesize(5, 1, 1)

再運(yùn)行turtle.shapesize(5, 1, 5)

turtle.shearfactor(shear=None),設(shè)置或者返回剪力。

turtle.tilt(angle),改變龜角度(按當(dāng)前角度改變),但不改變移動(dòng)方向。

turtle.settiltangle(angle),無(wú)論當(dāng)前是什么角度,重新設(shè)置一個(gè)指向角度。不改變移動(dòng)方向。自3.1版開(kāi)始不推薦使用。

turtle.tiltangle(angle=None),返回當(dāng)前傾斜角度,或重新設(shè)置一個(gè)指向角度。不改變移動(dòng)方向。

turtle.shapetransform(t11=None,?t12=None,?t21=None,?t22=None),設(shè)置或者返回龜形狀矩陣數(shù)據(jù)。

turtle.get_shapepoly(),返回當(dāng)前形狀多邊形作為坐標(biāo)對(duì)的元組。可用于定義復(fù)合形狀的新形狀。

畫(huà)個(gè)太極圖;

import turtle as t

t.home()

t.bgcolor('#ccc')

##大半圓黑色

t.color('#000')

t.fillcolor('#000')

t.begin_fill()

t.circle(100,180)

t.end_fill()

##大半圓白色

t.color('#fff')

t.fillcolor('#fff')

t.begin_fill()

t.circle(100,180)

t.end_fill()

t.up()

t.sety(100)

##中半圓白色

t.color('#fff')

t.fillcolor('#fff')

t.begin_fill()

t.circle(50,180)

t.end_fill()

t.up()

t.goto(0,0)

##中半圓黑色

t.color('#000')

t.fillcolor('#000')

t.begin_fill()

t.circle(-50,180)

t.end_fill()

##兩個(gè)小圓

t.up()

t.sety(34)

t.color('#fff')

t.fillcolor('#fff')

t.begin_fill()

t.circle(16,360)

t.end_fill()

t.up()

t.sety(134)

t.color('#000')

t.fillcolor('#000')

t.begin_fill()

t.circle(16,360)

t.end_fill()

t.ht()

如圖:

總結(jié)

以上是生活随笔為你收集整理的python龟图_python学习turtle(龟图标状态)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。