点击观看视频

# -*- 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. 10分钟轻松学会python turtle绘图

     1. 画布(canvas) 1.1 相关函数: 2. 画笔 2.1 画笔的状态 2.2 画笔的属性 2.3 绘图命令 3. 命令详解 4. 绘图举例 4.1 太阳花 4.2 绘制小蟒蛇 4.3 绘 ...

  3. 10分钟轻松学会 Python turtle 绘图

    python2.6版本中后引入的一个简单的绘图工具,叫做海龟绘图(Turtle Graphics),turtle库是python的内部库,使用导入即可 import turtle 先说明一下turtl ...

  4. python:turtle绘图模块

    turtle模块 海龟绘图(Turtle Graphics),python内置模块,非常简单好玩的一个库. 一.导入库 import turtle from turtle import * 二.画布的 ...

  5. python小白的初步爬虫

    前序:  最近工作不是很忙,领导突然找我谈话,说是谈话,其实就是分配活呗.果不其然,很快进入正题, 给了我一个网址链接,然后说需要商品的信息...巴拉巴拉.好吧,去做吧. 我当时的内心是崩溃的,pyt ...

  6. python课程设计笔记(三)turtle绘图库(海龟库)

    实例:绘制一条蟒蛇 #turtle:绘图库(海龟库) import turtle turtle.setup(650,350,200,200) turtle.penup() turtle.fd(-250 ...

  7. Python小白需要知道的 20 个骚操作!

    Python小白需要知道的 20 个骚操作! Python 是一个解释型语言,可读性与易用性让它越来越热门.正如 Python 之禅中所述: 优美胜于丑陋,明了胜于晦涩. 在你的日常编码中,以下技巧可 ...

  8. Django入门到进阶-更适合Python小白的系统课程

    Django入门到进阶-更适合Python小白的系统课程 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课程本身 ...

  9. Python小白

      .IDLE软件为内建于CPython的集成开发环境(IDE),包括编辑器,编译或解释器,调试器       .py(后缀保存) 2.行一,单行注释     多行,”””    ‘’’  之后,内建 ...

随机推荐

  1. 超详细的PDF Expert的注释功能介绍

    今天,要给大家很是详细地介绍一下PDF Expert(一款专门在mac上使用的PDF阅读编辑器)的注释功能,让有点健忘的各位小伙伴们通过积极地与文本交互,从而记住更多的专业书内容. 具体使用方法请看以 ...

  2. Element-ui框架checkbox复选框回显

    先看下效果是不是你需要的..... 然后废话不多说,上代码,希望能够帮助到你... <template> <div class=''> <el-form label-wi ...

  3. 初识ldap

    什么是LDAP? LDAP的英文全称是Lightweight Directory Access Protocol,一般都简称为LDAP.它是基于X.500标准的, 但是简单多了并且可以根据需要定制.与 ...

  4. 微信小程序1rpx border ios真机显示不全问题

    无意间测试发现,把border的颜色的透明度颜色改成0.99就可以了.1就不行. 边框显示不全的写法: border:1rpx solid rgba(244,84,80,1); 将边框代码的透明度改成 ...

  5. url路由配置以及渲染方式

    路由分配及模板渲染 路由系统 urlpatterns = [ path('admin/', admin.site.urls), path('teacher/',include('teacher.url ...

  6. python----数据驱动ddt的使用

    一.安装ddtpip install ddt 二.数据驱动和代码驱动数据驱动:根据你提供的数据来进行测试,比如接口自动化测试框架ATP代码驱动:必须得写代码才能测试,比如unittest 三.使用数据 ...

  7. 简易OA漫谈之工作流设计(一个Demo),完成6年前的一个贴子

    6年前在腾讯做OA,那时写了两篇心得. https://www.cnblogs.com/wangxiaohuo/archive/2012/08/22/2650893.html https://www. ...

  8. SQL语句全解,非常棒!

    链接自W3school非常详细的SQL教程 http://www.w3school.com.cn/sql/index.asp

  9. 关于Javascript中页面动态钟表的简单实现

    1.问题并不繁琐,在于HTML中 DOM(文档对象模型)方法的掌握,我的钟表实现重点用到了三个函数和一个事件 A)setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式.s ...

  10. JSP页面传值出现中文乱码的问题

    在接收值的jsp页面代码的body里添加: <%request.setCharacterEncoding("utf-8"); %>  //这里是设置utf-8为jsp页 ...