python滑稽脸_使用python的turtle绘画滑稽脸实例
使用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绘画滑稽脸实例相关推荐
- python 时间序列预测_使用Python进行动手时间序列预测
python 时间序列预测 Time series analysis is the endeavor of extracting meaningful summary and statistical ...
- python 概率分布模型_使用python的概率模型进行公司估值
python 概率分布模型 Note from Towards Data Science's editors: While we allow independent authors to publis ...
- python绘制滑稽脸_用Python画滑稽
滑稽 用turtle画滑稽笑脸 from turtle import* setup(600,600,200,200) #脸 penup() goto(-210,0) seth(-90) pendown ...
- 用python画微信捂脸_用 Python 画一个捂脸表情
微信中的捂脸表情相信大家都不陌生,我见过以及自己使用这个表情的频率都是比较高的,可以说这个表情算是大部分人的主打表情之一了,本文我使用 Python 来画一下这个表情,我们使用到的库还是 turtle ...
- 用python绘制图形_使用Python的turtle画炫酷图形
例子一: import turtle t = turtle.Pen() turtle.bgcolor("black") sides=6 colors=["red" ...
- python 图形模块_用Python的turtle模块绘制基本的几何图形
import turtle #正方形 ''' i=0 while i<4: turtle.forward(100) turtle.right(90) i+=1 turtle.hideturtle ...
- python绘制月亮_用python画月亮的代码是什么?
用python画月亮的代码是什么? 用python画月亮的代码是import turtle as t t.screensize(800,600,"#483d8b")#画布尺寸和颜色 ...
- python集群_使用Python集群文档
python集群 Natural Language Processing has made huge advancements in the last years. Currently, variou ...
- python 网页编程_通过Python编程检索网页
python 网页编程 The internet and the World Wide Web (WWW), is probably the most prominent source of info ...
- python机器学习预测_使用Python和机器学习预测未来的股市趋势
python机器学习预测 Note from Towards Data Science's editors: While we allow independent authors to publish ...
最新文章
- 用于ONNX的TensorRT后端
- OpenCV学习系列教程第五篇:测试和提高代码的效率
- GNU/LINUX(KaliUbuntu)安装chrome浏览器
- java中wait方法使用实例_java中wait、notify和notifyAll的概念用法和例子?
- excel调用python编程-用Python如何开发Excel宏脚本?新手必学
- python 声明变量类型_python基础学习03数据类型和变量
- Linux C :Linux 下第一个C程序
- harmonyos2.0怎么更新,harmonyOS 2.0什么时候更新 harmonyOS 2.0手机开发者Beta版更新内容[多图]...
- python自学-新手如何自学python课程?
- 刚大学毕业,学习的C++,到底能做什么?
- Race Condition是什么
- Ubuntu上成功安装永中office2009
- Fastjson源码阅读:缺陷静态检查(上)
- 理财学习02-基金误区
- ecshop打开手机端QQ对话窗口
- 生活随记-如何健康摄入果糖
- Evernote 印象笔记离线使用方法
- Android原生Switch禁止滑动实现
- 案例-使用python实现基于opencv的形状识别
- 莫顿码(Morton code)介绍