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存取XML的常见方法实例分析
Mar 21 Python
Python中elasticsearch插入和更新数据的实现方法
Apr 01 Python
浅谈python numpy中nonzero()的用法
Apr 02 Python
Sanic框架安装与简单入门示例
Jul 16 Python
对python requests发送json格式数据的实例详解
Dec 19 Python
Python+pyplot绘制带文本标注的柱状图方法
Jul 08 Python
python Django编写接口并用Jmeter测试的方法
Jul 31 Python
python实现的接收邮件功能示例【基于网易POP3服务器】
Sep 11 Python
pandas中遍历dataframe的每一个元素的实现
Oct 23 Python
python3中利用filter函数输出小于某个数的所有回文数实例
Nov 24 Python
VSCode配合pipenv搞定虚拟环境的实现方法
May 17 Python
python计算列表元素与乘积详情
Aug 05 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
PHP以mysqli方式连接类完整代码实例
2014/07/15 PHP
PHP中mysql_field_type()函数用法
2014/11/24 PHP
pjblog中的UBBCode.js
2007/04/25 Javascript
div层的移动及性能优化
2010/11/16 Javascript
JQuery解析HTML、JSON和XML实例详解
2014/03/29 Javascript
JS获得浏览器版本和操作系统版本的例子
2014/05/13 Javascript
jQuery 仿百度输入标签插件附效果图
2014/07/04 Javascript
jQuery实现简单的间隔向上滚动效果
2015/03/09 Javascript
jQuery 1.9.1源码分析系列(十五)动画处理之缓动动画核心Tween
2015/12/03 Javascript
JavaScript开发者必备的10个Sublime Text插件
2016/02/27 Javascript
js无法获取到html标签的属性的解决方法
2016/07/26 Javascript
nodejs+express实现文件上传下载管理网站
2017/03/15 NodeJs
使用Bootstrap和Vue实现用户信息的编辑删除功能
2017/10/25 Javascript
Vue.js划分组件的方法
2017/10/29 Javascript
vue引入axios同源跨域问题
2018/09/27 Javascript
微信小程序自定义可滑动顶部TabBar选项卡实现页面切换功能示例
2019/05/14 Javascript
js实现移动端吸顶效果
2020/01/08 Javascript
vue实现前端列表多条件筛选
2020/10/26 Javascript
Python的迭代器和生成器使用实例
2015/01/14 Python
Python实现抓取百度搜索结果页的网站标题信息
2015/01/22 Python
Python实现修改文件内容的方法分析
2018/03/25 Python
实例讲解Python中整数的最大值输出
2019/03/17 Python
Python中的支持向量机SVM的使用(附实例代码)
2019/06/26 Python
Django Python 获取请求头信息Content-Range的方法
2019/08/06 Python
Django实现文件上传和下载功能
2019/10/06 Python
Python任务调度模块APScheduler使用
2020/04/15 Python
CSS3中的transform属性进行2D和3D变换的基本用法
2016/05/12 HTML / CSS
html5自动播放mov格式视频的实例代码
2020/01/14 HTML / CSS
size?瑞典:英国伦敦的球鞋精品店
2018/03/01 全球购物
美国转售二手商品的电子商务平台:BLINQ
2018/12/13 全球购物
英国复古服装购物网站:Collectif
2019/10/30 全球购物
EntityManager都有哪些方法
2013/11/01 面试题
授权委托书(公民个人适用)
2014/09/19 职场文书
幼儿园小班见习报告
2014/10/31 职场文书
关于ObjectUtils.isEmpty() 和 null 的区别
2022/02/28 Java/Android
Vue3中toRef与toRefs的区别
2022/03/24 Vue.js