turtle 库
小鸭子简笔画
1 import turtle as t 2 t.setup(1200,800,200,500) 3 t.width(3) 4 #手 5 t.left(90) 6 t.bk(40) 7 t.fd(90) 8 t.circle(-60,90) 9 t.circle(-20,180) 10 t.left(90) 11 t.fd(80) 12 #头 13 t.bk(15) 14 t.left(90) 15 t.fd(160) 16 t.circle(80,90) 17 t.seth(90) 18 t.fd(60) 19 t.circle(190,170) 20 t.circle(170,40) 21 t.right(40) 22 t.circle(80,50) 23 t.circle(3,46) 24 t.fd(40) 25 #下身 26 t.seth(-175) 27 t.fd(45) 28 t.circle(10,170) 29 t.seth(-160) 30 t.fd(20) 31 t.seth(-90) 32 t.circle(170,130) 33 t.circle(150,75) 34 t.seth(-40) 35 t.circle(-90,110) 36 #五官 37 t.penup() 38 t.goto(210,110) 39 t.pendown() 40 t.seth(-120) 41 t.fd(70) 42 t.left(120) 43 t.fd(70) 44 t.left(120) 45 t.fd(70) 46 t.penup() 47 t.goto(240,120) 48 t.pendown() 49 t.width(20) 50 t.seth(90) 51 t.fd(60) 52 t.penup() 53 t.goto(180,120) 54 t.pendown() 55 t.fd(60)
引用turtle库
1)import turtle
2)import turtle as <库别名>
3)from turtle import <函数名》
4)from turtle import *
画布
turtle.setup(width,hight,startx,starty




浙公网安备 33010602011771号