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的即时标记项目练习笔记
Sep 18 Python
python实现bucket排序算法实例分析
May 04 Python
python利用Guetzli批量压缩图片
Mar 23 Python
Python多进程multiprocessing用法实例分析
Aug 18 Python
对python3 一组数值的归一化处理方法详解
Jul 11 Python
深入浅析Python中list的复制及深拷贝与浅拷贝
Sep 03 Python
matplotlib.pyplot绘图显示控制方法
Jan 15 Python
Python发展史及网络爬虫
Jun 19 Python
使用pygame编写Flappy bird小游戏
Mar 14 Python
pycharm 快速解决python代码冲突的问题
Jan 15 Python
matplotlib部件之套索Lasso的使用
Feb 24 Python
Pytorch 如何实现LSTM时间序列预测
May 17 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中jQuery插件autocomplate的简单使用笔记
2012/06/14 PHP
php获取文件名后缀常用方法小结
2015/02/24 PHP
thinkphp jquery实现图片上传和预览效果
2020/07/22 PHP
Laravel框架查询构造器简单示例
2019/05/08 PHP
用Javascript数组处理多个字符串的连接问题
2009/08/20 Javascript
javascript Firefox与IE 替换节点的方法
2010/02/24 Javascript
JavaScript 语言的递归编程
2010/05/18 Javascript
javascript工具库代码
2012/03/29 Javascript
Moment.js 不容错过的超棒Javascript日期处理类库
2012/04/15 Javascript
javascript之典型高阶函数应用介绍
2013/01/10 Javascript
JavaScript实现Java中StringBuffer的方法
2015/02/09 Javascript
jquery控制页面部分刷新的方法
2015/06/24 Javascript
理解javascript中的原型和原型链
2015/07/30 Javascript
JavaScript简单生成 N~M 之间随机数的方法
2017/01/13 Javascript
JavaScript错误处理和堆栈追踪详解
2017/04/18 Javascript
node使用UEditor富文本编辑器的方法实例
2017/07/11 Javascript
如何开发出更好的JavaScript模块
2017/12/22 Javascript
面试题:react和vue的区别分析
2019/04/08 Javascript
JavaScript之数组扁平化详解
2019/06/03 Javascript
ES6中Set和Map用法实例详解
2020/03/02 Javascript
解决Vue中的生命周期beforeDestory不触发的问题
2020/07/21 Javascript
Python Web框架Flask信号机制(signals)介绍
2015/01/01 Python
实例讲解Python爬取网页数据
2018/07/08 Python
Python中字符串String的基本内置函数与过滤字符模块函数的基本用法
2019/05/27 Python
python 调试冷知识(小结)
2019/11/11 Python
python异常处理try except过程解析
2020/02/03 Python
Python requests获取网页常用方法解析
2020/02/20 Python
俄罗斯EPL钻石珠宝店:ЭПЛ
2019/10/22 全球购物
《最可爱的人》教学反思
2014/02/14 职场文书
环境工程专业自荐信
2014/03/03 职场文书
社区道德讲堂实施方案
2014/03/21 职场文书
护士个人自我鉴定
2014/03/24 职场文书
2014年度个人总结范文
2015/03/09 职场文书
催款函范文
2015/06/24 职场文书
PyTorch 如何检查模型梯度是否可导
2021/06/05 Python
Python闭包的定义和使用方法
2022/04/11 Python