Python制作表白爱心合集


Posted in Python onJanuary 22, 2022
目录

导语

"盘子里最后一块肉给你 一 冰激凌的第一口给你 一手机最后的10%电量给你!"

哈喽大家好!我是木木子,我要开始给大家放大招啦

你来之后,苦都不太苦,甜都特别甜

如果人类有尾巴的话,说起来有点不好意思 ,只要和你在一起,一定会止不住摇起来

我害怕你找不到我,所以我要藏在你心里

I love three things in the world.The sun,the moon and you.The sun for the day,the moon for the night,and you for ever.

浮世万千,吾爱有三。日,月与卿。日为朝,月为暮,卿为朝朝暮暮。

下面这几套表白小项目送给大家 希望大家喜欢​

正文

一、爱心表白:做我女朋友吧,行就行,不行我再想想办法

1)效果展示

Python制作表白爱心合集

2)附主程序

t=turtle.pen()
t=turtle
t.up()
t.goto(0,150)
t.down()
t.color('pink')
t.begin_fill()
t.fillcolor('pink')
t.speed(1)
t.left(45)
t.forward(150)
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(250+math.sqrt(2)*100)
t.right (90)
t.speed(2)
t.forward(250+100*math.sqrt(2))
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(150)
t.end_fill()
t.goto(-10,0)
t.pencolor('white')
#L
t.pensize(10)
t.goto(-50,0)
t.goto(-50,80)
t.up ()
#I
t.goto(-100,0)
t.down()
t.goto(-160,0)
t.goto(-130,0)
t.goto(-130,80)
t.goto(-160,80)
t.goto(-100,80)
t.up()
#O
t.goto(10,25)
t.down()
t.right(45)
t.circle(25,extent=180)
t.goto(60,55)
t.circle(25,extent=180)
t.goto(10,25)
t.up()
t.goto(75,80)
t.down()
t.goto(100,0)
t.goto(125,80)
t.up()
t.goto(180,80)
t.down()
t.goto(140,80)
t.goto(140,0)
t.goto(180,0)
t.up()
t.goto(180,40)
t.down()
t.goto(140,40)
#U
t.up()
t.goto(-40,-30)
t.down()
t.goto(-40,-80)
t.circle(40,extent=180)
t.goto(40,-30)
t.hideturtle()
a=input()

二、爱心表白:?有两个心愿:你在身边,在你身边

1)效果展示

Python制作表白爱心合集

2)附主程序

pen = turtle.Turtle()
pen.hideturtle()

pen.fillcolor('pink')
pen.begin_fill()

# set the starting direction
pen.left(110)

# draw the left bottom part
while pen.heading() < 140:
    # rotate & forward
    pen.left(1)
    pen.forward(2)

# move up
pen.forward(90)

# draw the left upper part
while pen.xcor() < 0:
    pen.right(0.8)
    pen.forward(1)

# go back to the starting point, and do the right part as a mirror
pen.up()
pen.goto(0, 0)
pen.down()

# set the direction
pen.setheading(70)

# draw the right bottom part
while pen.heading() > 40:
    # Defining step by step curve motion
    pen.right(1)
    pen.forward(2)

# move up
pen.forward(90)

# draw the right upper part
while pen.xcor() > 0:
    print(pen.xcor())
    pen.left(0.8)
    pen.forward(1)

# Ending the filling of the color
pen.end_fill()

三、爱心表白:君初相识,犹如故人归。天涯明月新,朝暮最相思

1)效果展示​

Python制作表白爱心合集

2)附主程序

import turtle as t

def heart(x,y,z):    # 绘制爱心
    t.pensize(2)
    t.pencolor("black")
    if z == 1:
        t.fillcolor("red")
    elif z == 0:
        t.fillcolor("pink")
    t.begin_fill()     #左半边
    t.penup()
    t.goto(x,y)
    t.pendown()
    t.circle(50,180)
    t.circle(180,37)
    t.left(46)      #右半边
    t.circle(180,37)
    t.circle(50, 182)
    t.end_fill()
def arrow1(x,y):
   t.pensize(5)
    t.pencolor("black")
    t.fillcolor("brown")
    t.penup()
    t.goto(x, y)
    t.pendown()
    t.setheading(210)
    t.forward(150)
    t.begin_fill()
    t.left(30)
    t.forward(20)
    t.right(30)
    t.forward(50)
    t.right(150)
    t.forward(20)
    t.left(120)
    t.forward(20)
    t.right(150)
    t.forward(50)
    t.right(30)
    t.forward(20)
    t.end_fill()
def arrow2(x, y):
    t.pensize(5)
    t.pencolor("black")
    t.fillcolor("brown")
    t.penup()
    t.goto(x, y)
    t.pendown()
    t.begin_fill()
    t.setheading(30)
    t.forward(100)
    t.left(90)
    t.forward(8)
    t.right(120)
    t.forward(16)
    t.right(120)
    t.forward(16)
    t.right(120)
    t.forward(8)
    t.end_fill()
def main():
    t.setheading(90)
    heart(50, 130, 0)
    t.setheading(120)
    heart(0, 100, 1)
    arrow1(-20, 60)
    arrow2(100, 130)
    t.hideturtle()
    t.exitonclick()

以上就是Python制作表白爱心合集的详细内容,更多关于Python表白爱心的资料请关注三水点靠木其它相关文章!

Python 相关文章推荐
Python函数参数类型*、**的区别
Apr 11 Python
python根据京东商品url获取产品价格
Aug 09 Python
用Python写冒泡排序代码
Apr 12 Python
python3 拼接字符串的7种方法
Sep 12 Python
python os.listdir按文件存取时间顺序列出目录的实例
Oct 21 Python
python tkinter实现界面切换的示例代码
Jun 14 Python
nginx搭建基于python的web环境的实现步骤
Jan 03 Python
Python使用Socket实现简单聊天程序
Feb 28 Python
Pandas将列表(List)转换为数据框(Dataframe)
Apr 24 Python
python 从list中随机取值的方法
Nov 16 Python
python3中数组逆序输出方法
Dec 01 Python
Python中读取文件名中的数字的实例详解
Dec 25 Python
基于Python实现一个春节倒计时脚本
Jan 22 #Python
详解Python如何批量采集京东商品数据流程
Jan 22 #Python
用Python实现屏幕截图详解
Jan 22 #Python
Python实现学生管理系统并生成exe可执行文件详解流程
Jan 22 #Python
django中websocket的具体使用
Jan 22 #Python
Django+Nginx+uWSGI 定时任务的实现方法
Jan 22 #Python
梳理总结Python开发中需要摒弃的18个坏习惯
Jan 22 #Python
You might like
PHP5 面向对象(学习记录)
2009/12/02 PHP
PHP将session信息存储到数据库的类实例
2015/03/04 PHP
PHP配合fiddler抓包抓取微信指数小程序数据的实现方法分析
2020/01/02 PHP
PHP哈希表实现算法原理解析
2020/12/11 PHP
JavaScript call apply使用 JavaScript对象的方法绑定到DOM事件后this指向问题
2011/09/28 Javascript
jQuery 1.8 Release版本发布了
2012/08/14 Javascript
给jQuery方法添加回调函数一款插件的应用
2013/01/21 Javascript
JS 去除Array中的null值示例代码
2013/11/20 Javascript
JavaScript获取当前网页标题(title)的方法
2015/04/03 Javascript
原生js和jquery实现图片轮播淡入淡出效果
2015/04/23 Javascript
jquery实现可点击伸缩与展开的菜单效果代码
2015/08/31 Javascript
JavaScript知识点总结(五)之Javascript中两个等于号(==)和三个等于号(===)的区别
2016/05/31 Javascript
Bootstrap字体图标无法正常显示的解决方法
2016/10/08 Javascript
微信小程序  wx.request合法域名配置详解
2016/11/23 Javascript
js禁止Backspace键使浏览器后退的实现方法
2017/09/01 Javascript
基于$.ajax()方法从服务器获取json数据的几种方式总结
2018/01/31 Javascript
webpack4 处理SCSS的方法示例
2018/09/03 Javascript
Chrome插件开发系列一:弹窗终结者开发实战
2020/10/02 Javascript
[14:24]Optic Gaming vs PSG LGD BO3
2018/06/07 DOTA
用Python给文本创立向量空间模型的教程
2015/04/23 Python
解密Python中的描述符(descriptor)
2015/06/03 Python
Python入门之三角函数sin()函数实例详解
2017/11/08 Python
Python地图绘制实操详解
2019/03/04 Python
Python3实现计算两个数组的交集算法示例
2019/04/03 Python
Python Flask框架扩展操作示例
2019/05/03 Python
Python常用模块之requests模块用法分析
2019/05/15 Python
python安装pil库方法及代码
2019/06/25 Python
Django框架之登录后自定义跳转页面的实现方法
2019/07/18 Python
django最快程序开发流程详解
2019/07/19 Python
详解基于canvas的视频遮罩插件
2018/01/04 HTML / CSS
澳大利亚时尚前卫设计师珠宝在线:Amber Sceats
2017/10/04 全球购物
美国购买新书和二手书网站:Better World Books
2018/10/31 全球购物
Ajax请求总共有多少种Callback
2016/07/17 面试题
用基于python的appium爬取b站直播消费记录
2021/04/17 Python
实例讲解Python中sys.argv[]的用法
2021/06/03 Python
Java8 Stream API 提供了一种高效且易于使用的处理数据的方式
2022/04/13 Java/Android