python七夕浪漫表白源码
作者:计科李昂 时间:2021-09-27 23:22:13
本文实例为大家分享了python七夕浪漫表白的具体代码,供大家参考,具体内容如下
from turtle import *
from time import sleep
def go_to(x, y):
up()
goto(x, y)
down()
def big_Circle(size): #函数用于绘制心的大圆
speed(1)
for i in range(150):
forward(size)
right(0.3)
def small_Circle(size): #函数用于绘制心的小圆
speed(1)
for i in range(210):
forward(size)
right(0.786)
def line(size):
speed(1)
forward(51*size)
def heart( x, y, size):
go_to(x, y)
left(150)
begin_fill()
line(size)
big_Circle(size)
small_Circle(size)
left(120)
small_Circle(size)
big_Circle(size)
line(size)
end_fill()
def arrow():
pensize(10)
setheading(0)
go_to(-400, 0)
left(15)
forward(150)
go_to(339, 178)
forward(150)
def arrowHead():
pensize(1)
speed(1)
color('red', 'red')
begin_fill()
left(120)
forward(20)
right(150)
forward(35)
right(120)
forward(35)
right(150)
forward(20)
end_fill()
def main():
pensize(2)
color('red', 'pink')
#getscreen().tracer(30, 0) #取消注释后,快速显示图案
heart(200, 0, 1) #画出第一颗心,前面两个参数控制心的位置,函数最后一个参数可控制心的大小
setheading(0) #使画笔的方向朝向x轴正方向
heart(-80, -100, 1.5) #画出第二颗心
arrow() #画出穿过两颗心的直线
arrowHead() #画出箭的箭头
go_to(400, -300)
write("author:520Python", move=True, align="left", font=("宋体", 30, "normal"))
done()
main()
效果如下:
来源:https://blog.csdn.net/ITxiaoangzai/article/details/81783519
标签:python,表白
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
css布局查看器
2008-10-29 11:22:00
asp利用aspjpeg给图片生成PNG透明水印
2009-03-20 14:01:00
PHP获取类中常量,属性,及方法列表的方法
2023-11-19 19:57:58
解决Dreamweaver不支持中文文件名方法
2008-01-09 12:52:00
Pandas中Series的属性,方法,常用操作使用案例
2021-11-22 05:00:47
![](https://img.aspxhome.com/file/2023/1/83771_0s.png)
Python中如何实现MOOC扫码登录
2021-10-08 14:24:50
![](https://img.aspxhome.com/file/2023/1/66861_0s.png)
微信公众号开发之获取位置信息php代码
2023-11-17 06:33:15
解决pycharm中导入自己写的.py函数出错问题
2023-07-09 12:12:05
![](https://img.aspxhome.com/file/2023/2/60302_0s.jpg)
ServerXMLHTTP的setTimeouts超时设置
2010-01-02 20:38:00
Python ckeditor富文本编辑器代码实例解析
2023-08-23 13:03:44
使用pdb模块调试Python程序实例
2023-08-11 08:36:28
交互设计师应该具备哪些素质
2009-03-12 12:21:00
用户体验与心流理论
2008-09-23 11:51:00
python使用电子邮件模块smtplib的方法
2023-09-29 20:20:38
![](https://img.aspxhome.com/file/2023/3/63203_0s.jpg)
python获取百度热榜链接的实例方法
2022-10-02 23:10:01
![](https://img.aspxhome.com/file/2023/6/82936_0s.png)
Laravel框架实现点播上传阿里云功能
2023-06-13 20:13:30
用书的概念理解小网站结构
2007-10-31 18:08:00
Python 图像处理 Pillow 库详情
2022-12-05 04:46:12
PHP解决高并发问题(opcache)
2023-11-07 23:17:49
![](https://img.aspxhome.com/file/2023/3/62033_0s.png)
JavaScript 获取客户端计算机硬件及系统信息
2009-01-13 17:59:00
![](https://img.aspxhome.com/file/UploadPic/20091/13/200901081050518738-49s.gif)