久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      python繪制正方形螺旋線

      本篇文章介紹了python中使用turtle庫(kù)繪制正方形螺旋線的方法,代碼很簡(jiǎn)單,希望對(duì)正在學(xué)習(xí)python中的同學(xué)有幫助!

      python繪制正方形螺旋線

      python繪制正方形螺旋線

      使用python繪制螺旋形,使用了turtle庫(kù),這是python2.6版本中后引入的一個(gè)簡(jiǎn)單的繪圖工具,叫做海龜繪圖(Turtle Graphics),turtle庫(kù)是python的內(nèi)部庫(kù),使用時(shí)導(dǎo)入即可。

      import turtle as t t.pen(speed=0)   #加快繪圖速度 t.penup() t.goto(-200, -200)     #以左下角某處為起點(diǎn) t.pendown() t.seth(0) length = 400 while (length !=0):    #利用正方形螺旋線的性質(zhì)來繪圖     t.fd(length)     t.left(90)     length -= 2.5 t.hideturtle()         #繪圖結(jié)束后把海龜頭(筆觸頭)隱藏起來 t.done()               #繪圖結(jié)束后使窗口停留

      效果圖

      python繪制正方形螺旋線

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)