python圣诞节快乐_用python让大白对你说圣诞快乐
这是整体的效果:
话不多说,直接上代码:
# coding=utf-8
# This is a sample Python script.
import turtle as t
import time
# 初始化画布
t.setup(width=800, height=600)
time.sleep(2)
t.hideturtle()
t.color("#FF6A6A")
t.penup()
t.goto(-300,220)
words1 = '当 '
words2 = ['送','给','小','可','爱']
for i in range(4):
t.write(words1, font=("华文彩云", 3*i+14, "bold"))
t.forward(20+3*i)
time.sleep(0.15)
t.forward(8)
t.write("!", font=("华文彩云", 23, "bold"))
t.forward(20)
time.sleep(0.5)
for word in words2:
t.write(word, font=("华文彩云", 26, "bold"))
t.forward(35)
time.sleep(0.4)
t.write(":", font=("华文彩云", 23, "bold"))
t.forward(35)
#大白
#头
t.goto(-100,150)
t.right(90)
t.color("black")
t.pensize(1)
t.pendown()
size = 0.6
a = 0.8*size
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a = a + 0.2*size
t.left(3) # 向左转3度
t.forward(a) # 向前走a的步长
else:
a = a - 0.2*size
t.left(3)
t.forward(a)
t.penup()
#眼睛
time.sleep(0.5)
t.goto(-70,150)
t.dot(14)
time.sleep(0.5)
t.goto(-24,150)
t.dot(14)
time.sleep(0.5)
t.right(60)
t.pendown()
t.speed(2)
t.circle(-50,50)
#身体
t.penup()
t.goto(-89.85,131.47)
t.left(65)
t.pendown()
t.circle(250,60)
t.penup()
t.goto(-2.64,133.09)
t.left(30)
t.pendown()
t.circle(-250,60)
t.right(20)
t.circle(-134,110)
#腿
t.penup()
t.left(135)
t.goto(-120,-145)
t.pendown()
t.circle(120,45)
t.left(15)
t.circle(42,80)
t.left(50)
t.forward(70)
t.penup()
t.back(70)
t.pendown()
t.right(130)
t.circle(42,80)
t.left(15)
t.circle(115,48)
t.penup()
#胳膊
t.goto(-125,89)
t.pendown()
t.left(112)
t.circle(250,50)
t.circle(50,45)
t.circle(20,80)
t.circle(50,45)
t.circle(180,16)
t.penup()
t.goto(31,90)
t.pendown()
t.right(126)
t.circle(-250,50)
t.circle(-50,45)
t.circle(-20,80)
t.circle(-50,45)
t.circle(-180,14)
#手
t.penup()
t.goto(-208,-90)
t.pendown()
t.left(150)
t.right(180)
t.circle(-30,20)
t.penup()
t.goto(-208,-90)
t.right(160)
t.pendown()
t.circle(30,40)
t.circle(5,120)
t.circle(40,40)
#画玫瑰
t.penup()
t.goto(-270,60)
t.pendown()
#玫瑰花角度
t.right(60)
#玫瑰花大小
size=0.35
# 花蕊
t.fillcolor("#EE0000")
t.begin_fill()
t.circle(10*size, 180)
t.circle(25*size, 110)
t.left(50)
t.circle(60*size, 45)
t.circle(20*size, 170)
t.right(24)
t.forward(30*size)
t.left(10)
t.circle(30*size, 110)
t.forward(20*size)
t.left(40)
t.circle(90*size, 70)
t.circle(30*size, 150)
t.right(30)
t.forward(15*size)
t.circle(80*size, 90)
t.left(15)
t.forward(45*size)
t.right(165)
t.forward(20*size)
t.left(155)
t.circle(150*size, 80)
t.left(50)
t.circle(150*size, 90)
t.end_fill()
# 花瓣1
t.left(150)
t.circle(-90*size, 70)
t.left(20)
t.circle(75*size, 105)
t.setheading(80)
t.circle(80*size, 98)
t.circle(-90*size, 40)
# 花瓣2
t.left(180)
t.circle(90*size, 40)
t.circle(-80*size, 98)
t.setheading(-63.5)
# 叶子1
t.forward(30*size)
t.left(90)
t.forward(25*size)
t.left(45)
t.fillcolor("#00CD00")
t.begin_fill()
t.circle(-80*size, 90)
t.right(90)
t.circle(-80*size, 90)
t.end_fill()
t.right(135)
t.forward(60*size)
t.left(180)
t.penup()
t.forward(85*size)
t.pendown()
t.left(90)
t.forward(80*size)
# 叶子2
t.right(90)
t.right(45)
t.fillcolor("#00CD00")
t.begin_fill()
t.circle(80*size, 90)
t.left(90)
t.circle(80*size, 90)
t.end_fill()
t.left(135)
t.forward(60*size)
t.left(180)
t.forward(60*size)
t.right(90)
t.circle(-1000*size,8.6)
t.penup()
t.goto(-200,-110)
t.pendown()
t.circle(-1000*size,10)
#圣诞快乐
words3 = ['圣 ','诞 ','快 ','乐 ','呦 ','!']
t.penup()
t.color("#FF6A6A")
t.goto(30,220)
t.setheading(0)
for word in words3:
t.write(word, font=("华文彩云", 26, "bold"))
t.forward(35)
time.sleep(0.4)
t.done()
感谢阅读!!!
多说一句,很多人学Python过程中会遇到各种烦恼问题,没有人解答容易放弃。小编是一名python开发工程师,这里有我自己整理了一套最新的python系统学习教程,包括从基础的python脚本到web开发、爬虫、数据分析、数据可视化、机器学习等。想要这些资料的可以关注小编,并在后台私信小编:“01”即可领取。
python圣诞节快乐_用python让大白对你说圣诞快乐相关推荐
- 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创作自己的圣诞节动图贺卡,制作简单即刻生成
引言 圣诞节就在眼前,怎样诚挚表达自己的心意呢,自己动手做一个定制动图贺卡,写上定制的祈福语,收到贺卡的人一定很开心. 干货 废话不多说,直接上源代码.Python 3环境直接运行,无任何依赖. 修改 ...
- python七夕快乐_用22种语言祝大家七夕节快乐!
原标题:用22种语言祝大家七夕节快乐! C:printf("祝大家七夕快乐!"); C++ : cout< QBasic : Print "祝大家七夕快乐!&quo ...
- python queue 调试_学Python不是盲目的,是有做过功课认真去了解的
有多少伙伴是因为一句'人生苦短,我用Python'萌生想法学Python的!我跟大家更新过很多Python学习教程普及过多次的Python相关知识,不过大家还是还得计划一下Python学习路线!Pyt ...
- 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 ...
- python高斯求和_利用Python进行数据分析(3)- 列表、元组、字典、集合
本文主要是对Python的数据结构进行了一个总结,常见的数据结构包含:列表list.元组tuple.字典dict和集合set. image 索引 左边0开始,右边-1开始 通过index()函数查看索 ...
最新文章
- protobuf前后端解析_Go语言微服务架构实战:第七节 Protobuf协议语法及原理
- 神策数据王灼洲 徐缓:ID-Mapping 用户打通那些事儿
- Nginx面试中最常见的18道题及答案
- DOM编程练习(慕课网题目)
- Unity环境下RTMP推流+RTMP播放低延迟解决方案
- 计算机excelsumif的公式,EXCELsumif函数的用法展示
- python qt5 增加文本框_Python用PyQt5制作弹出式输入框,Qt图形界面编程之QInputDialog...
- 最流畅的手机,性能、跑分却弱爆了?2019年上半年手机数据报告出炉
- [预告]将要推出编程方式事务管理祥解!
- HTML5视频播放器
- mysql替换占位符_【占位符替换】替换String中的占位符标志位{placeholder}
- 小米游戏本bios更新_小米游戏本 | 笔记本Air 13.3″ 四核 | 笔记本Air 12.5″ | 笔记本Pro 15.6″BIOS设置...
- Mac电脑上如何添加打印机
- ASML公司Q3季度营收27.9亿欧元
- Android 状态栏适配
- 程序员的密码管理之道
- cephadm全功能安装Ceph Pacfic
- 205. Isomorphic Strings
- 最近大火的 NFT 数字藏品是什么?
- 【转载】音频基础知识
热门文章
- Linux进程控制——exec函数族
- Android--开发资源管理器/优化ListView显示列表方法
- Hadoop3.0基础平台搭建(三节点),以及案例运行并使用python生成词云
- UNIX文件mode t详解
- 什么是机器人的五点校正法_样品定量检测怎样选择内标法和外标法!
- html掷骰子小游戏,网页实现掷骰子小游戏
- oracle10g重新配置crs,Oracle 10G RAC一节点系统重做后修复
- android p获取通话记录_HBuilder 获取通话记录 (Android)
- orcale 非非等于_oracle 不等于1怎么查?
- python的全称_python名称空间介绍