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

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

生活随笔

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

python

python3.7怎么安装turtle_python怎么安装turtle

發(fā)布時(shí)間:2023/12/10 python 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python3.7怎么安装turtle_python怎么安装turtle 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

turtle庫(kù)是Python語(yǔ)言中一個(gè)很流行的繪制圖像的函數(shù)庫(kù),想象一個(gè)小烏龜,在一個(gè)橫軸為x、縱軸為y的坐標(biāo)系原點(diǎn),(0,0)位置開(kāi)始,它根據(jù)一組函數(shù)指令的控制,在這個(gè)平面坐標(biāo)系中移動(dòng),從而在它爬行的路徑上繪制了圖形。

安裝turtle(推薦學(xué)習(xí):Python視頻教程)

Python2安裝命令:pip install turtule

Python3安裝命令:pip3 install turtle

繪圖舉例

太陽(yáng)花import turtle as timport time

t.color("red", "yellow")

t.speed(10)

t.begin_fill()for _ in range(50):

t.forward(200)

t.left(170)

end_fill()

time.sleep(1)

繪制五角星import turtleimport time

turtle.pensize(5)

turtle.pencolor("yellow")

turtle.fillcolor("red")

turtle.begin_fill()for _ in range(5):

turtle.forward(200)

turtle.right(144)

turtle.end_fill()

time.sleep(2)

turtle.penup()

turtle.goto(-150,-120)

turtle.color("violet")

turtle.write("Done", font=('Arial', 40, 'normal'))

time.sleep(1)

更多Python相關(guān)技術(shù)文章,請(qǐng)?jiān)L問(wèn)Python教程欄目進(jìn)行學(xué)習(xí)!

以上就是python怎么安裝turtle的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!

本文原創(chuàng)發(fā)布php中文網(wǎng),轉(zhuǎn)載請(qǐng)注明出處,感謝您的尊重!

總結(jié)

以上是生活随笔為你收集整理的python3.7怎么安装turtle_python怎么安装turtle的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

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