标签:setup div col click com src star class display
#PythonDraw.py import turtle #绘图库 turtle.setup(1000, 1000, 0, 0) ‘‘‘ turtle.setup(width, height, startx, starty),设置画布窗体的大小及位置,4个参数中后两个可选setup()不是必须的 ‘‘‘ turtle.penup() turtle.fd(-250) turtle.pendown() turtle.pensize(25) turtle.pencolor("blue") turtle.seth(-40) for i in range(4): turtle.circle(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()
#在直角坐标系走到哪里
seth()改变海龟行进方向, angle为绝对度数, seth()只改变方向但不行进
seth设置绝对角度
turtle.left则是海龟向左向右转多少度
- 1.0:RGB小数值模式
- 255:RGB整数值模式
1 turtle.penup() ,别名 turtle.pu()抬起画笔,海龟在飞行; 2 turtle.pendown() ,别名 turtle.pd()落下画笔,海龟在爬行; 3 turtle.pensize(width),别名 turtle.width(width), 画笔宽度,海龟的腰围; 4 turtle.pencolor(color) ,color为颜色字符串或r,g,b值画笔颜色,海龟在涂装; 5 - 颜色字符串 :turtle.pencolor("purple") 6 - RGB的小数值:turtle.pencolor(0.63, 0.13, 0.94) 7 - RGB的元组值:turtle.pencolor((0.63,0.13,0.94))
1 根据半径r绘制extent角度的弧形 2 - r: 默认圆心在海龟左侧r距离的位置 3 - extent: 绘制角度,默认是360度整圆
标签:setup div col click com src star class display
原文地址:https://www.cnblogs.com/lianghaiming/p/12466158.html