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 01 Python
Python3.6通过自带的urllib通过get或post方法请求url的实例
May 10 Python
python 获取当天每个准点时间戳的实例
May 22 Python
Django 限制用户访问频率的中间件的实现
Aug 23 Python
python+flask实现API的方法
Nov 21 Python
Golang GBK转UTF-8的例子
Aug 26 Python
python shutil文件操作工具使用实例分析
Dec 25 Python
Python函数的返回值、匿名函数lambda、filter函数、map函数、reduce函数用法实例分析
Dec 26 Python
解决安装新版PyQt5、PyQT5-tool后打不开并Designer.exe提示no Qt platform plugin的问题
Apr 24 Python
Python图像处理之膨胀与腐蚀的操作
Feb 07 Python
Python djanjo之csrf防跨站攻击实验过程
May 14 Python
Python字符串的转义字符
Apr 07 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类中的魔术方法(Magic Method)简明总结
2014/07/08 PHP
PHP使用Redis长连接的方法详解
2018/02/12 PHP
解决php extension 加载顺序问题
2019/08/16 PHP
ext 代码生成器
2009/08/07 Javascript
微信支付如何实现内置浏览器的H5页面支付
2015/09/25 Javascript
基于Javascript实现弹出页面效果
2016/01/01 Javascript
一篇文章掌握RequireJS常用知识
2016/01/26 Javascript
Angularjs 滚动加载更多数据
2016/03/17 Javascript
原生js获取元素样式的简单方法
2016/08/06 Javascript
Node.js的环境安装配置(使用nvm方式)
2016/10/11 Javascript
正则表达式,替换所有HTML标签的简单实例
2016/11/28 Javascript
Vue0.1的过滤代码如何添加到Vue2.0直接使用
2017/08/23 Javascript
vue-prop父组件向子组件进行传值的方法
2018/03/01 Javascript
如何编写一个d.ts文件的步骤详解
2018/04/13 Javascript
ES6 更易于继承的类语法的使用
2019/02/11 Javascript
Vue项目路由刷新的实现代码
2019/04/17 Javascript
解决Element中el-date-picker组件不回填的情况
2020/11/07 Javascript
pyramid配置session的方法教程
2013/11/27 Python
跟老齐学Python之print详解
2014/09/28 Python
python实现获取客户机上指定文件并传输到服务器的方法
2015/03/16 Python
Python socket编程实例详解
2015/05/27 Python
python实现用户登录系统
2016/05/21 Python
Python画图学习入门教程
2016/07/01 Python
python3+PyQt5实现自定义窗口部件Counters
2018/04/20 Python
numpy实现合并多维矩阵、list的扩展方法
2018/05/08 Python
基于python实现的百度音乐下载器python pyqt改进版(附代码)
2019/08/05 Python
python实现拼图小游戏
2020/02/22 Python
介绍一些UNIX常用简单命令
2014/11/11 面试题
小学教育毕业生自荐信
2013/11/18 职场文书
教师个人的自我评价分享
2014/01/02 职场文书
《燕子》教学反思
2014/02/18 职场文书
物联网工程专业推荐信
2014/09/08 职场文书
产品陈列协议书(标准版)
2014/09/17 职场文书
生日宴会祝酒词
2015/08/10 职场文书
2019年恭贺升学祝福语集锦
2019/08/15 职场文书
Apache Calcite 实现方言转换的代码
2021/04/24 Servers