用法:
turtle.speed(speed=None)
speed- 0..10 範圍內的整數或速度字符串(見下文)
參數:
將 turtle 的速度設置為 0..10 範圍內的整數值。如果沒有給出參數,則返回當前速度。
如果輸入是大於 10 或小於 0.5 的數字,則速度設置為 0。速度字符串映射到速度值,如下所示:
- “fastest”:0
- “fast”:10
- “normal”:6
- “slow”:3
- “slowest”: 1
從 1 到 10 的速度強製執行越來越快的線條繪製和 turtle 轉動動畫。
注意:
speed
= 0 表示發生no
動畫。前進/後退使 turtle 跳躍,同樣左/右使 turtle 立即轉動。>>> turtle.speed() 3 >>> turtle.speed('normal') >>> turtle.speed() 6 >>> turtle.speed(9) >>> turtle.speed() 9
相關用法
- Python turtle.speed()用法及代碼示例
- Python turtle.shapesize用法及代碼示例
- Python turtle.setworldcoordinates()用法及代碼示例
- Python turtle.shape()用法及代碼示例
- Python turtle.setx()用法及代碼示例
- Python turtle.settiltangle()用法及代碼示例
- Python turtle.screensize用法及代碼示例
- Python turtle.shape用法及代碼示例
- Python turtle.setup用法及代碼示例
- Python turtle.shapetransform()用法及代碼示例
- Python turtle.sety用法及代碼示例
- Python turtle.settiltangle用法及代碼示例
- Python turtle.stamp用法及代碼示例
- Python turtle.setundobuffer()用法及代碼示例
- Python turtle.showturtle()用法及代碼示例
- Python turtle.shapetransform用法及代碼示例
- Python turtle.stamp()用法及代碼示例
- Python turtle.shearfactor()用法及代碼示例
- Python turtle.setx用法及代碼示例
- Python turtle.shearfactor用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 turtle.speed。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。