代码如下

#使用turtle库绘制紫砂壶
import turtle as t
t.title('紫砂壶')
t.pensize(2)#画笔宽度
t.pencolor('black')#画笔颜色
t.speed(100)
#t.tracer(0)
t.hideturtle()#隐藏画笔
#画布
#设置画布大小#画壶盖
t.penup()#提笔
t.goto(-170,100)#去坐标
t.setheading(50)#笔的角度
t.pendown()#落笔
t.circle(-150,100)#画圆,-号代表顺时针,第一个数为半径,第二个数为圆心角#画半圆
t.penup()
t.goto(-40,158)
t.setheading(40)
t.pendown()
t.circle(10,110)
t.setheading(155)
t.circle(30,50)
t.setheading(210)
t.circle(10,110)t.penup()
t.goto(-40,158)
t.setheading(310)
t.pendown()
t.forward(8)t.penup()
t.goto(-68,158)
t.setheading(230)
t.pendown()
t.forward(8)#画第一条直线
t.penup()
t.goto(-190,100)
t.setheading(0)
t.pendown()
t.forward(270)#画直线
#画第二条线
t.penup()
t.goto(-190,90)
t.setheading(0)
t.pendown()
t.forward(270)
#画第三条直线
t.penup()
t.goto(-190,80)
t.setheading(0)
t.pendown()
t.forward(270)#画两个半圆
t.penup()
t.goto(-190,100)
t.setheading(180)
t.pendown()
t.circle(5,180)t.setheading(180)
t.circle(5,180)t.penup()
t.goto(80,80)
t.setheading(0)
t.pendown()
t.circle(5,180)
t.setheading(0)
t.circle(5,180)#画壶身
t.penup()
t.goto(-190,80)
t.setheading(220)
t.pendown()
t.circle(100,130)
t.setheading(0)
t.forward(177)
#壶底第二条直线
t.penup()
t.goto(-142,-103)
t.setheading(0)
t.pendown()
t.forward(177)t.penup()
t.goto(-142,-103)
t.setheading(180)
t.pendown()
t.circle(-4,180)t.penup()
t.goto(35,-103)
t.setheading(0)
t.pendown()
t.circle(4,180)#壶身右半圆
t.penup()
t.goto(80,80)
t.setheading(-40)
t.pendown()
t.circle(-100,130)#画壶把内圈
t.penup()
t.goto(115,20)
t.setheading(90)
t.pendown()
t.circle(-40,40)t.setheading(50)
t.circle(-30,110)t.setheading(290)
t.circle(-60,55)t.setheading(230)
t.circle(-60,10)t.setheading(210)
t.circle(-50,55)#画壶把外圈
t.penup()
t.goto(105,-40)
t.setheading(340)
t.pendown()
t.circle(95,48)t.setheading(42)
t.circle(75,40)t.setheading(80)
t.circle(80,20)t.setheading(100)
t.circle(60,15)t.setheading(124)
t.circle(60,110)#画壶嘴上半部分
t.penup()
t.goto(-220,40)
t.setheading(146)
t.pendown()
t.forward(70)t.setheading(180)
t.forward(40)#画壶嘴下半部分
t.penup()
t.goto(-210,-50)
t.setheading(130)
t.pendown()
t.forward(166)#画兰草
t.pensize(4)t.penup()
t.goto(-71,-80)
t.setheading(80)
t.pendown()
t.circle(-200,50)t.penup()
t.goto(-79,-80)
t.setheading(90)
t.pendown()
t.circle(-200,30)t.penup()
t.goto(-88,-80)
t.setheading(90)
t.pendown()
t.circle(-240,30)t.penup()
t.goto(-98,-80)
t.setheading(75)
t.pendown()
t.circle(130,60)t.penup()
t.goto(-108,-80)
t.setheading(90)
t.pendown()
t.circle(180,55)#绘图结束画布不消失
t.done()

用python turtle库画了个紫砂壶相关推荐

  1. 用Python Turtle库画一个萌化的蜘蛛侠

    你是从什么时候开始喜欢上漫威电影的?美国队长,钢铁侠,雷神? 我先入坑的是因为看了蜘蛛侠,小时候看完就幻想着什么时候自己也能成为一个英雄,我觉得第一代蜘蛛侠刻画得是最好的,也是给我印象最深刻的一代蜘蛛 ...

  2. python turtle库画七彩蟒蛇_Python Turtle库绘制蟒蛇

    使用Python Turtle库来绘制蟒蛇 import turtle引入了海龟绘图体系 使用setup函数,设定了一个宽650像素和高350像素的窗体,其位置左上角坐标是200,200 说明位置在距 ...

  3. Python Turtle库画一棵对称勾股树,美丽惊艳的分形世界!

    分形,具有以非整数维形式充填空间的形态特征.通常被定义为"一个粗糙或零碎的几何形状,可以分成数个部分,且每一部分都(至少近似地)是整体缩小后的形状",即具有自相似的性质.分形(Fr ...

  4. python turtle库画图案-Python基础图形绘制库——turtle

    (1).介绍 turtle库也叫海龟库,是turtle绘图体系的Python实现.turtle库是Python语言的标准库之一,是入门级的图形绘制函数库. turtle绘图体系:也叫海龟绘图系统,它是 ...

  5. python turtle库画图案-python中的turtle库绘制图形

    1. 前奏: 在用turtle绘制图形时,需要安装对应python的解释器以及IDE,我安装的是pycharm,在安装完pycharm后,在pycharm安装相应库的模块,绘图可以引入turtle模块 ...

  6. python turtle库画图案-Python如何使用turtle库绘制图形

    1. 前奏: 在用turtle绘制图形时,需要安装对应python的解释器以及IDE,我安装的是pycharm,在安装完pycharm后,在pycharm安装相应库的模块,绘图可以引入turtle模块 ...

  7. 一篇文教你使用python Turtle库画出“精美碎花小清新风格树”快来拿代码!

    Turtle库手册可以查询查询 python图形绘制库turtle中文开发文档及示例大全,手册中现有示例,不需要自己动手就可以查看演示. 文章修改记录 修改记录 1:2020年5月17日 12:06: ...

  8. python turtle库画七彩蟒蛇_Python学习之turtle库和蟒蛇绘制程序

    Python的函数库 Python语言与C语言Java类似,可以大量使用外部函数库包含在安装包中的函数库:. 比如math, random, turtle等其他函数库,其他函数库用户根据代码需求自行安 ...

  9. python turtle库画图案-python库之turtle(图形绘制) 开启新的快乐源泉

    相信有不少人学习python 都是听了老前辈的推荐 "学python好,python有趣的代码多" 比如说画一只小狮子 这就是今天想要介绍的绘制图形库-turtle 如果也想这样画 ...

最新文章

  1. QIIME 2教程. 13训练特征分类器TrainingFeatureClassifiers(2021.2)
  2. C 语言编程 — 高级数据类型 — 数组
  3. 网站做好后不能用手机浏览吗_企业几年前制作的网站大部分都应该被淘汰掉
  4. #pragma pack
  5. 串结构练习——字符串连接
  6. Algorithm:C++/python语言实现之求旋转数组最小值、求零子数组、求最长公共子序列和最长公共子串、求LCS与字符串编辑距离
  7. c++ 结构体地址 转换成ulong_零基础入门之结构体字节对齐
  8. 天翼云从业认证(3.2)天翼云存储产品
  9. pycharm解决Inconsistent indentation:mix of tabs and spaces
  10. [转] 一次Ajax查错的经历
  11. 大话设计模式—责任链模式
  12. openoffice 安装windows 环境
  13. DNS 解析过程详解
  14. 智能优化算法:黏菌优化算法 - 附代码
  15. KL散度 JS散度 熵
  16. 基于MATLAB语音识别系统GUI界面
  17. word底色怎么去掉的办法
  18. 计算机启动死机,电脑开机突然死机怎么回事?小编教你解决开机死机问题
  19. 电脑上个别按键失灵可能原因
  20. 无尽的生命 洛谷p2448

热门文章

  1. linux上传文件权限命令,Linux 普通用户拿到root权限及使用szrz命令上传下载文件...
  2. 【华为OD机试真题 python】任务最优调度 【2021 H2, 2022 Q1,Q2 考试题】
  3. 《官方直译版》6.使用Spring Boot-构建系统
  4. 微信不能存钱美国微信服务器,微信、支付宝为什么突然不能存款了?
  5. 苹果M1不仅终结Intel的PC业务,更可能导致X86的覆灭
  6. java 对 汉字排序(按照拼音字母排序)
  7. android 5.1 白名单,iqoo5如何将应用加密 iqoo5一键设置应用白名单方法分享
  8. 设计模式-单例模式及应用场景
  9. 如何读取图片上的文字?简单的方法分析给你
  10. 语句覆盖率\条件覆盖率\路径覆盖率\分支覆盖率的区别您知道吗