python图形设置_python学习笔记——基本图形绘制
1、python蟒蛇python蟒蛇代碼
#PythonDraw.py
import turtle
turtle.setup(650,350,200,200)# 設(shè)置畫布的長、寬、起點(diǎn)
turtle.penup()
turtle.fd(-250)# 走直線(負(fù)數(shù)表示倒退)
turtle.pendown()#or turtle.pd() 落下畫筆
turtle.pensize(25)#畫筆寬度
turtle.pencolor("green")# 畫筆顏色:顏色字符串 RGB的小數(shù)值 元組值
turtle.seth(-40)# 改變行進(jìn)方向
for i in range(4):#循環(huán)語句 0 1 2 3
turtle.circle(40,80)# 左側(cè)半徑為40,角度為80
turtle.circle(-40,80)
turtle.circle(40,80/2)
turtle.fd(40)
turtle.circle(16,180)
turtle.fd(40*2/3)
turtle.done()
繪制的蟒蛇
2、turtle繪圖庫
setup()
penup()
pendown()
fd()
pensize()
.........
寒假準(zhǔn)備學(xué)習(xí)python,為了督促自己,也為了整理一些學(xué)習(xí)筆記,我將會(huì)把自己的學(xué)習(xí)過程及筆記記錄下來,也希望給大家一些幫助吧。
總結(jié)
以上是生活随笔為你收集整理的python图形设置_python学习笔记——基本图形绘制的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python事件触发机制_Python3
- 下一篇: python存储问题_python学习永