使用python的turtle绘画滑稽脸实例

发布时间:2020-09-13 03:46:34

来源:脚本之家

阅读:104

作者:氵小景

这是借鉴了一位兄弟的代码,然后进行修改的,原来代码存在问题,用了2小时,自己修改,终于画出了滑稽脸,也算是对于今天学的turtle绘画库的一个小小的记录吧!(有错误希望各位看官指正啊)

编译器是:Atom

python 是3.7版本

运行位 Windows power shell

import turtle

turtle.setup(600,600,200,200)

#fcae

turtle.penup()

turtle.goto(-210,0)

turtle.seth(-90)

turtle.pendown()

turtle.pencolor(‘orange')

turtle.pensize(4)

turtle.begin_fill()

turtle.circle(210,360)

turtle.fillcolor(‘yellow')

turtle.end_fill()

turtle.pencolor(‘black')

#mouth

turtle.pensize(5)

turtle.penup()

turtle.goto(-150,30)

turtle.pendown()

turtle.seth(-90)

turtle.circle(150,180)

#left eye

turtle.penup()

turtle.pensize(4)

turtle.goto(-180,90)

turtle.pendown()

turtle.seth(40)

turtle.begin_fill()

turtle.circle(-120,80)

turtle.penup()

turtle.goto(-180,90)

turtle.pendown()

turtle.seth(-130)

turtle.circle(15,110)

turtle.seth(40)

turtle.circle(-106,83)

turtle.seth(30)

turtle.circle(18,105)

turtle.fillcolor(‘white')

turtle.end_fill()

#right eye

turtle.penup()

turtle.goto(20,90)

turtle.pendown()

turtle.seth(40)

turtle.begin_fill()

turtle.circle(-120,80)

turtle.penup()

turtle.goto(20,90)

turtle.pendown()

turtle.seth(-130)

turtle.circle(15,110)

turtle.seth(40)

turtle.circle(-106,83)

turtle.seth(30)

turtle.circle(18,105)

turtle.fillcolor(‘white')

turtle.end_fill()

#Eyeball

turtle.pensize(2)

turtle.penup()

turtle.goto(50,95)

turtle.pendown()

turtle.begin_fill()

turtle.circle(8,360)

turtle.fillcolor(‘black')

turtle.end_fill()

turtle.penup()

turtle.goto(-150,95)

turtle.pendown()

turtle.begin_fill()

turtle.circle(8,360)

turtle.fillcolor(‘black')

turtle.end_fill()

#Blush

turtle.pensize(1)

turtle.pencolor(‘pink')

turtle.begin_fill()

turtle.penup()

turtle.goto(-160,50)

turtle.pendown()

turtle.seth(-90)

for i in range(2):

for j in range(10):

turtle.forward(j)

turtle.left(9)

for j in range(10,0,-1):

turtle.forward(j)

turtle.left(9)

turtle.fillcolor(‘pink')

turtle.end_fill()

turtle.pensize(1)

turtle.pencolor(‘pink')

turtle.begin_fill()

turtle.penup()

turtle.goto(40,50)

turtle.pendown()

turtle.seth(-90)

for i in range(2):

for j in range(10):

turtle.forward(j)

turtle.left(9)

for j in range(10,0,-1):

turtle.forward(j)

turtle.left(9)

turtle.fillcolor(‘pink')

turtle.end_fill()

turtle.hideturtle()

turtle.done()

以上这篇使用python的turtle绘画滑稽脸实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持亿速云。

python滑稽脸_使用python的turtle绘画滑稽脸实例相关推荐

  1. python 时间序列预测_使用Python进行动手时间序列预测

    python 时间序列预测 Time series analysis is the endeavor of extracting meaningful summary and statistical ...

  2. python 概率分布模型_使用python的概率模型进行公司估值

    python 概率分布模型 Note from Towards Data Science's editors: While we allow independent authors to publis ...

  3. python绘制滑稽脸_用Python画滑稽

    滑稽 用turtle画滑稽笑脸 from turtle import* setup(600,600,200,200) #脸 penup() goto(-210,0) seth(-90) pendown ...

  4. 用python画微信捂脸_用 Python 画一个捂脸表情

    微信中的捂脸表情相信大家都不陌生,我见过以及自己使用这个表情的频率都是比较高的,可以说这个表情算是大部分人的主打表情之一了,本文我使用 Python 来画一下这个表情,我们使用到的库还是 turtle ...

  5. 用python绘制图形_使用Python的turtle画炫酷图形

    例子一: import turtle t = turtle.Pen() turtle.bgcolor("black") sides=6 colors=["red" ...

  6. python 图形模块_用Python的turtle模块绘制基本的几何图形

    import turtle #正方形 ''' i=0 while i<4: turtle.forward(100) turtle.right(90) i+=1 turtle.hideturtle ...

  7. python绘制月亮_用python画月亮的代码是什么?

    用python画月亮的代码是什么? 用python画月亮的代码是import turtle as t t.screensize(800,600,"#483d8b")#画布尺寸和颜色 ...

  8. python集群_使用Python集群文档

    python集群 Natural Language Processing has made huge advancements in the last years. Currently, variou ...

  9. python 网页编程_通过Python编程检索网页

    python 网页编程 The internet and the World Wide Web (WWW), is probably the most prominent source of info ...

  10. python机器学习预测_使用Python和机器学习预测未来的股市趋势

    python机器学习预测 Note from Towards Data Science's editors: While we allow independent authors to publish ...

最新文章

  1. 用于ONNX的TensorRT后端
  2. OpenCV学习系列教程第五篇:测试和提高代码的效率
  3. GNU/LINUX(KaliUbuntu)安装chrome浏览器
  4. java中wait方法使用实例_java中wait、notify和notifyAll的概念用法和例子?
  5. excel调用python编程-用Python如何开发Excel宏脚本?新手必学
  6. python 声明变量类型_python基础学习03数据类型和变量
  7. Linux C :Linux 下第一个C程序
  8. harmonyos2.0怎么更新,harmonyOS 2.0什么时候更新 harmonyOS 2.0手机开发者Beta版更新内容[多图]...
  9. python自学-新手如何自学python课程?
  10. 刚大学毕业,学习的C++,到底能做什么?
  11. Race Condition是什么
  12. Ubuntu上成功安装永中office2009
  13. Fastjson源码阅读:缺陷静态检查(上)
  14. 理财学习02-基金误区
  15. ecshop打开手机端QQ对话窗口
  16. 生活随记-如何健康摄入果糖
  17. Evernote 印象笔记离线使用方法
  18. Android原生Switch禁止滑动实现
  19. 案例-使用python实现基于opencv的形状识别
  20. 莫顿码(Morton code)介绍

热门文章

  1. 层次分析matlab例题,层次分析法例题
  2. 使用layUI弹出输入框并收集输入框信息
  3. 如何配置NSSA区域?
  4. HttpClient忽略SSL证书,附带百度网盘jar包
  5. React 父组件获取子组件的方法/数据(useRef
  6. 亲民地理-第39期-佛山(2)南风古灶_我是亲民_新浪博客
  7. 中文分词(上)——获取和Word2Vec模型构建
  8. 电信HG2201T网关(部分地区的电信网关2.0)超级密码获取
  9. 案例分析 | 贝壳找房:自我颠覆的整合式创新引领产业数字化
  10. 计算机术语BOOTP,bootp是什么意思?