资源简介
学习CSDN公众号推荐python学习资料,继续完善学习,应用turtle工具 绘画小猪佩奇

代码片段和文件信息
# -*- coding:UTF-8 -*-
from turtle import *
from test._mock_backport import right
from pip._vendor.pyparsing import Forward
def nose(xy):#鼻子
penup()#提起笔
goto(xy)#定位
pendown()#落笔,开始画
setheading(-30)#将乌龟的方向设置为to_angle/为数字(0-东、90-北、180-西、270-南)
begin_fill()#准备开始填充图形
a=0.4
for i in range(120):
if 0<=i<30 or 60<=i<90:
a=a+0.08
left(3) #向左转3度
forward(a) #向前走a的步长
else:
a=a-0.08
left(3)
forward(a)
end_fill()#填充完成
penup()
setheading(90)
forward(25)
setheading(0)
forward(10)
pendown()
pencolor(255155192)#画笔颜色
setheading(10)
begin_fill()
circle(5)
color(1608245)#返回或设置pencolor和fillcolor
end_fill()
penup()
setheading(0)
forward(20)
pendown()
pencolor(255155192)
setheading(10)
begin_fill()
circle(5)
color(1608245)
end_fill()
def head(xy):#头
color((255155192)“pink“)
penup()
goto(xy)
setheading(0)
pendown()
begin_fill()
setheading(180)
circle(300-30)
circle(100-60)
circle(80-100)
circle(150-20)
circle(60-95)
setheading(161)
circle(-30015)
penup()
goto(-100100)
pendown()
setheading(-30)
a=0.4
for i in range(60):
if 0<=i<30 or 60<=i<90:
a=a+0.08
lt(3) #向左转3度
fd(a) #向前走a的步长
else:
a=a-0.08
lt(3)
fd(a)
end_fill()
def ears(xy): #耳朵
color((255155192)“pink“)
penup()
goto(xy)
pendown()
begin_fill()
setheading(100)
circle(-5050)
circle(-10120)
circle(-5054)
end_fill()
penup()
setheading(90)
forward(-12)
setheading(0)
forward(30)
pendown()
begin_fill()
setheading(100)
circle(-5050)
circle(-10120)
circle(-5056)
end_fill()
def eyes(xy):#眼睛
color((255155192)“white“)
penup()
setheading(90)
forward(-20)
setheading(0)
forward(-95)
pendown()
begin_fill()
circle(15)
end_fill()
color(“black“)
penup()
setheading(90)
forward(12)
setheading(0)
forward(-3)
pendown()
begin_fill()
circle(3)
end_fill()
color((255155192)“white“)
penup()
seth(90)
forward(-25)
seth(0)
forward(40)
pendown()
begin_fill()
circle(15)
end_fill()
color(“black“)
penup()
setheading(90)
forward(12)
setheading(0)
forward(-3)
pendown()
begin_fill()
circle(3)
end_fill()
def cheek(xy):#腮
color((255155192))
penup()
goto(xy)
pendown()
setheading(0)
begin_fill()
circle(30)
end_fill()
def mouth(xy): #嘴
color(2396919)
penup()
goto(xy)
pendown()
setheading(-80)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6406 2018-06-08 11:48 CSDN推送小猪佩奇学习代码\new.py
文件 6127 2018-06-08 11:50 CSDN推送小猪佩奇学习代码\源码.txt
目录 0 2018-06-08 11:50 CSDN推送小猪佩奇学习代码\
相关资源
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
- 量化交易(附python常见函数的使用方
- python 名字用字排行
评论
共有 条评论