Python turtle库画图

您所在的位置:网站首页 人民英雄纪念碑立体图 Python turtle库画图

Python turtle库画图

2024-07-13 13:38| 来源: 网络整理| 查看: 265

好久没玩Python了,拿turtle库来练练手 一开始看到纪念碑谷的图片真的惊呆了我 太漂亮了 这次的图片主要是由俩部分构成 一是三维方框 二是上面的那个小人

import turtle as t t.setup(800,500) t.hideturtle() t.speed(9) #填充背景图 t.seth(180) t.penup() t.fd(400) t.seth(90) t.fd(250) t.pendown() t.color(0.85,0.43,0.83) t.begin_fill() t.seth(0) t.fd(800) t.seth(-90) t.fd(500) t.seth(180) t.fd(800) t.seth(90) t.fd(500) t.end_fill() t.penup() t.seth(0) t.fd(400) t.seth(-90) t.fd(250) t.speed(9) #第一个框 t.color("blue") t.begin_fill() t.seth(90) t.penup() t.fd(10) t.pendown() t.fd(195) t.seth(-29) t.fd(169) t.right(120) t.fd(20) t.seth(150) t.fd(130) t.left(120) t.fd(180) t.seth(170) t.fd(17) t.seth(90) t.fd(197) t.end_fill() #抬起画笔移动到第二个起始地址 t.penup() t.seth(180) t.fd(1) t.seth(90) t.fd(6) t.pendown() #第二个框 t.color(0.01,0.65,0.61) t.begin_fill() t.seth(60) t.fd(18) t.seth(-29) t.fd(198) t.right(120) t.fd(172) t.seth(90) t.fd(19) t.right(59) t.fd(130) t.end_fill() #抬起画笔移动到第三个起始地址 t.p


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3