# -*- coding: utf-8 -*-
"""
Created on Sat Nov 10 22:02:32 2018 @author: 10029
""" import turtle #区域
def my_goto(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown() def eyes():
turtle.tracer(False)
a = 2.5
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a -= 0.05
turtle.lt(3)
turtle.fd(a)
else:
a += 0.05
turtle.lt(3)
turtle.fd(a)
turtle.tracer(True)
# 头
turtle.pensize(3)
turtle.penup()
turtle.circle(150, 40)
turtle.pendown()
turtle.fillcolor('#00a0de')
turtle.begin_fill()
turtle.circle(150, 280)
turtle.end_fill()
#围巾
turtle.fillcolor('#e70010')
turtle.begin_fill()
turtle.seth(0)
turtle.fd(200)
turtle.circle(-5, 90)
turtle.fd(10)
turtle.circle(-5, 90)
turtle.fd(207)
turtle.circle(-5, 90)
turtle.fd(10)
turtle.circle(-5, 90)
turtle.end_fill() # 脸
turtle.fd(183)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.lt(45)
turtle.circle(120, 100) turtle.seth(90)
eyes() turtle.seth(180)
turtle.penup()
turtle.fd(60)
turtle.pendown()
turtle.seth(90)
eyes() turtle.penup()
turtle.seth(180)
turtle.fd(64)
turtle.pendown()
turtle.seth(215)
turtle.circle(120, 100)
turtle.end_fill() # 鼻子 my_goto(-10, 158)
turtle.fillcolor('#e70010')
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill() # 嘴巴 my_goto(5, 148)
turtle.seth(270)
turtle.fd(100)
turtle.seth(0)
turtle.circle(120, 50)
turtle.seth(230)
turtle.circle(-120, 100) # 胡须 my_goto(-37, 135)
turtle.seth(165)
turtle.fd(60) my_goto(-37, 125)
turtle.seth(180)
turtle.fd(60) my_goto(-37, 115)
turtle.seth(193)
turtle.fd(60) my_goto(37, 135)
turtle.seth(15)
turtle.fd(60) my_goto(37, 125)
turtle.seth(0)
turtle.fd(60) my_goto(37, 115)
turtle.seth(-13)
turtle.fd(60) my_goto(0, 0)
turtle.seth(0)
turtle.penup()
turtle.circle(150, 50)
turtle.pendown()
turtle.seth(30)
turtle.fd(40)
turtle.seth(70)
turtle.circle(-30, 270) turtle.fillcolor('#00a0de')
turtle.begin_fill() turtle.seth(230)
turtle.fd(80)
turtle.seth(90)
turtle.circle(1000, 1)
turtle.seth(-89)
turtle.circle(-1000, 10) turtle.seth(180)
turtle.fd(70)
turtle.seth(90)
turtle.circle(30, 180)
turtle.seth(180)
turtle.fd(70) turtle.seth(100)
turtle.circle(-1000, 9) turtle.seth(-86)
turtle.circle(1000, 2)
turtle.seth(230)
turtle.fd(40) turtle.circle(-30, 230)
turtle.seth(45)
turtle.fd(81)
turtle.seth(0)
turtle.fd(203)
turtle.circle(5, 90)
turtle.fd(10)
turtle.circle(5, 90)
turtle.fd(7)
turtle.seth(40)
turtle.circle(150, 10)
turtle.seth(30)
turtle.fd(40)
turtle.end_fill() # 左手
turtle.seth(70)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.circle(-30)
turtle.end_fill() # 右手
my_goto(-133.97, -91.81)
turtle.seth(50)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill() # 脚
my_goto(103.74, -182.59)
turtle.seth(0)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.fd(15)
turtle.circle(-15, 180)
turtle.fd(90)
turtle.circle(-15, 180)
turtle.fd(10)
turtle.end_fill() my_goto(-96.26, -182.59)
turtle.seth(180)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.fd(15)
turtle.circle(15, 180)
turtle.fd(90)
turtle.circle(15, 180)
turtle.fd(10)
turtle.end_fill() # 口袋
my_goto(-103.42, 15.09)
turtle.seth(0)
turtle.fd(38)
turtle.seth(230)
turtle.begin_fill()
turtle.circle(90, 260)
turtle.end_fill() my_goto(5, -40)
turtle.seth(0)
turtle.fd(70)
turtle.seth(-90)
turtle.circle(-70, 180)
turtle.seth(0)
turtle.fd(70) #铃铛
my_goto(-103.42, 15.09)
turtle.fd(90)
turtle.seth(70)
turtle.fillcolor('#ffd200')
turtle.begin_fill()
turtle.circle(-20)
turtle.end_fill()
turtle.seth(170)
turtle.fillcolor('#ffd200')
turtle.begin_fill()
turtle.circle(-2, 180)
turtle.seth(10)
turtle.circle(-100, 22)
turtle.circle(-2, 180)
turtle.seth(180-10)
turtle.circle(100, 22)
turtle.end_fill()
turtle.goto(-13.42, 15.09)
turtle.seth(250)
turtle.circle(20, 110)
turtle.seth(90)
turtle.fd(15)
turtle.dot(10)
my_goto(0, -150) # 眼睛
turtle.seth(0)
my_goto(-20, 195)
turtle.fillcolor('#000000')
turtle.begin_fill()
turtle.circle(13)
turtle.end_fill() turtle.pensize(6)
my_goto(20, 205)
turtle.seth(75)
turtle.circle(-10, 150)
turtle.pensize(3) my_goto(-17, 200)
turtle.seth(0)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.circle(5)
turtle.end_fill()
my_goto(0, 0) turtle.exitonclick()

Python小白绘图 哆唻A梦 turtle真的很强大!的更多相关文章

  1. Python小白 哆唻a梦 用turtle绘图

    点击观看视频 # -*- coding: utf-8 -*- """ Created on Sat Nov 10 22:02:32 2018 @author: 10029 ...

  2. Python之绘图和可视化

    Python之绘图和可视化 1. 启用matplotlib 最常用的Pylab模式的IPython(IPython --pylab) 2. matplotlib的图像都位于Figure对象中. 可以使 ...

  3. Python小白的数学建模课-09 微分方程模型

    小白往往听到微分方程就觉得害怕,其实数学建模中的微分方程模型不仅没那么复杂,而且很容易写出高水平的数模论文. 本文介绍微分方程模型的建模与求解,通过常微分方程.常微分方程组.高阶常微分方程 3个案例手 ...

  4. Python小白的数学建模课-B5. 新冠疫情 SEIR模型

    传染病的数学模型是数学建模中的典型问题,常见的传染病模型有 SI.SIR.SIRS.SEIR 模型. 考虑存在易感者.暴露者.患病者和康复者四类人群,适用于具有潜伏期.治愈后获得终身免疫的传染病. 本 ...

  5. Python小白的数学建模课-B6. 新冠疫情 SEIR 改进模型

    传染病的数学模型是数学建模中的典型问题,常见的传染病模型有 SI.SIR.SIRS.SEIR 模型. SEIR 模型考虑存在易感者.暴露者.患病者和康复者四类人群,适用于具有潜伏期.治愈后获得终身免疫 ...

  6. Python小白的数学建模课-B4. 新冠疫情 SIR模型

    Python小白的数学建模课-B4. 新冠疫情 SIR模型 传染病的数学模型是数学建模中的典型问题,常见的传染病模型有 SI.SIR.SIRS.SEIR 模型. SIR 模型将人群分为易感者(S类). ...

  7. Python小白的数学建模课-16.最短路径算法

    最短路径问题是图论研究中的经典算法问题,用于计算图中一个顶点到另一个顶点的最短路径. 在图论中,最短路径长度与最短路径距离却是不同的概念和问题,经常会被混淆. 求最短路径长度的常用算法是 Dijkst ...

  8. Python小白的数学建模课-15.图论基本概念

    图论中所说的图,不是图形图像或地图,而是指由顶点和边所构成的图形结构. 图论不仅与拓扑学.计算机数据结构和算法密切相关,而且正在成为机器学习的关键技术. 本系列结合数学建模的应用需求,来介绍 Netw ...

  9. Python小白的数学建模课-19.网络流优化问题

    流在生活中十分常见,例如交通系统中的人流.车流.物流,供水管网中的水流,金融系统中的现金流,网络中的信息流.网络流优化问题是基本的网络优化问题,应用非常广泛. 网络流优化问题最重要的指标是边的成本和容 ...

随机推荐

  1. python学习之可视化tkinter基础

  2. vue 移动端轻量日期组件不依赖第三方库

    Vue版移动端日期选择组件 1.优点:不需要依赖其他第三方库,灵活可配置: 不需要依赖第三方组件的vue日期移动端组件  小轮子 轻量可复用:  https://github.com/BeckReed ...

  3. idea使用eclipse 代码format风格

    为了保证大家代码格式一样,避免在合代码时很出现大面积冲突.针对eclipse和idea两种开发工具进行了代码风格统一. Eclipse 使用方法:Windows → Preferences → Jav ...

  4. The innodb_system data file 'ibdata1' must be writable

    在安装MySQL的时候报的错,我理解的这个错是因为有个文件是Innodb需要在安装MySQL(或者创建数据库的时候)的时候需要写入这个文件,但是他现在没有写的权限. 日志中的错误是: 5.7版本以前是 ...

  5. Spring官方文档下载

    Spring框架是目前最流行的java web开发框架,很多时候,我们需要去查看spring的官方文档,这里就简单介绍下如何下载其官方文档. 1.搜索到spring 官网并进入 2.点击DOCS 3. ...

  6. 使用 ZipArchive 生成Zip文件备注

    近两日研究了Abp.io 中模板项目的生成原理,是从Github下载源码包,进行修改.替换,然后生成新的zip包提供下载. 项目内部使用了  这个包 Ionic.Zip  Version=" ...

  7. FastDFS 与 Nginx 实现分布式图片服务器

    FastDFS 与 Nginx 实现分布式图片服务器 本人的 Ubuntu18.04 用户名为 jj 点我下载所有所需的压缩包文件 一.FastDFS安装 1.安装 fastdfs 依赖包 ① 解压 ...

  8. spring(spring mvc)整合WebSocket案例(获取请求参数)

    开发环境(最低版本):spring 4.0+java7+tomcat7.0.47+sockjs 前端页面要引入: <script src="http://cdn.jsdelivr.ne ...

  9. systemd的日志管理进程journald

    使用Journalctl查看并操作Systemd日志 systemd拥有强大的处理与系统日志记录功能.在使用其它工具时,日志往往被分散在多套系统当中,由不同的守护进程负责处理. Journal的实现归 ...

  10. 14. Longest Common Prefix ★

    题目内容:Write a function to find the longest common prefix string amongst an array of strings 题目分析:本题目利 ...