python3实现表白神器
作者:不入行不改昵称 时间:2023-07-27 03:54:01
本文实例为大家分享了使用python3制作的表白神器,供大家参考,具体内容如下
使用python3制作的小玩意,哪里需要改造的,望各位评论一下!
#coding=utf-8
#第一个小项目/love 0.0.4
#该程序目的是为了表白而诞生的
#程序原创者:文
import time
import turtle
i = 0
q = 2
name = ['某某','某某某','1'] #填写她名字
lovename = ['文', '1'] #这里填写你的名字
def yanchi():
time.sleep(3) #此出应选3,如需调试,请将此出写0
def love():
print('')
print(' // ////// // // ////////// ')
print(' // // // // // // ')
print(' // /// /// // // // ')
print(' // /// /// // // ////////// ')
print(' // /// /// // // // ')
print(' // // // // // // ')
print(' ///////// ////// /// ////////// ')
def tuxing():
def hart_arc():
for i in range(200):
turtle.right(1)
turtle.forward(2)
def move_pen_position(x, y):
turtle.hideturtle() # 隐藏画笔(先)
turtle.up() # 提笔
turtle.goto(x, y) # 移动画笔到指定起始坐标(窗口中心为0,0)
turtle.down() # 下笔
turtle.showturtle() # 显示画笔
love = ''
signature = 'Mr.文' #这里填写你的名字
if love == '':
love = 'I Love You'
# 初始化
turtle.setup(width=800, height=500) # 窗口(画布)大小
turtle.color('red', 'pink') # 画笔颜色
turtle.pensize(3) # 画笔粗细
turtle.speed(1) # 描绘速度
# 初始化画笔起始坐标
move_pen_position(x=0,y=-180) # 移动画笔位置
turtle.left(140) # 向左旋转140度
turtle.begin_fill() # 标记背景填充位置
# 画心形直线( 左下方 )
turtle.forward(224) # 向前移动画笔,长度为224
# 画爱心圆弧
hart_arc() # 左侧圆弧
turtle.left(120) # 调整画笔角度
hart_arc() # 右侧圆弧
# 画心形直线( 右下方 )
turtle.forward(224)
turtle.end_fill() # 标记背景填充结束位置
# 在心形中写上表白话语
move_pen_position(0,0) # 表白语位置
turtle.hideturtle() # 隐藏画笔
turtle.color('#CD5C5C', 'pink') # 字体颜色
# font:设定字体、尺寸(电脑下存在的字体都可设置) align:中心对齐
turtle.write(love, font=('Arial', 30, 'bold'), align="center")
# 签写署名
if signature != '':
turtle.color('red', 'pink')
time.sleep(2)
move_pen_position(180, -180)
turtle.hideturtle() # 隐藏画笔
turtle.write(signature, font=('Arial', 20), align="center")
# 点击窗口关闭程序
window = turtle.Screen()
window.exitonclick()
print('程序载入中....')
yanchi()
love()
yanchi()
print('')
print('='*70)
print('='*70)
yanchi()
print('(提示:您有三次输入的机会!三次过后直接退出。)')
while i<3:
i+=1
print('='*70)
insertName = input('请准确的输入你的名字: ')
print('='*70)
if insertName in name:
print('Hello,%s,Welcome。'%insertName)
print('='*70)
break
else:
print('(提示:您有三次输入的机会!)')
print('第%d输入错误!剩余%d次!'%(i,q))
q-=1
if q==-1:
print('你是不是故意的。。。!')
yanchi()
input('程序已结束,请按回车键退出!!!')
exit()
print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) #显示本地时间
print('来玩玩游戏吧,选一个')
print('1、猜猜谁最在乎你')
print('2、即将推出')
print('3、即将推出')
xuanxiang = input('选一个吧:')
while xuanxiang == ''or'2'or'3':
if xuanxiang == '':
xuanxiang1 = '不能为空白哦'
if xuanxiang == '2'or '3':
xuanxiang1 = '此选项即将推出'
if xuanxiang == '1':
break
xuanxiang = input('%s,请重新选一个吧:'%xuanxiang1)
if xuanxiang == '1':
while True:
love = input('请输入你认为谁最在乎你的那个人的名字吧:')
print('='*70)
if love in lovename:
print('='*70)
yanchi()
print('*'*70)
print('如果你看到下面这句话的话,就告诉他吧,他等你很久了。')
print('*'*70)
tuxing()
print('不要让后来的我们什么都有了,却没有了我们。。。。')
print('*'*70)
print('*'*70)
break
else:
print('输入错了,再好好考虑考虑,要不然不给你出去,哼,重新输入!!!')
print('='*70)
time.sleep(5)
input('程序执行完毕,按回车键退出!')
来源:https://blog.csdn.net/weixin_42038955/article/details/86486150
标签:python,python3,表白神器
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
浅谈MySql update会锁定哪些范围的数据
2024-01-26 21:40:34
![](https://img.aspxhome.com/file/2023/9/113979_0s.jpg)
十几行的超简日历组件(兼容FF)js源码
2010-08-08 08:49:00
java URL 获取PHP JSON 数据
2023-11-14 18:02:02
讲解SQL Server危险扩展存储删除和恢复
2008-12-09 14:30:00
解决TensorFlow程序无限制占用GPU的方法
2021-11-22 13:13:44
![](https://img.aspxhome.com/file/2023/0/95560_0s.png)
numpy模块中axis的理解与使用
2023-06-26 22:55:28
python 图像插值 最近邻、双线性、双三次实例
2023-01-09 07:48:56
Go每日一库之quicktemplate的使用
2023-06-28 01:03:15
扫盲大讲堂:SQL查询结果集对注入的影响及利用
2009-09-05 09:49:00
Python中np.random.randint()参数详解及用法实例
2022-04-17 19:40:48
![](https://img.aspxhome.com/file/2023/5/92375_0s.jpg)
MySQL数据库索引order by排序精讲
2024-01-17 09:33:43
![](https://img.aspxhome.com/file/2023/5/69755_0s.png)
python解决字符串倒序输出的问题
2022-06-08 14:12:34
Django的URLconf中使用缺省视图参数的方法
2021-05-03 17:46:29
python datetime时间格式的相互转换问题
2023-12-22 01:04:29
![](https://img.aspxhome.com/file/2023/7/93677_0s.jpg)
Win定时任务执行php脚本
2024-05-06 10:07:55
![](https://img.aspxhome.com/file/202403/1709774539842860s.jpeg)
Python 统计数据集标签的类别及数目操作
2023-04-08 12:04:09
![](https://img.aspxhome.com/file/2023/8/77678_0s.png)
Python GUI布局尺寸适配方法
2022-03-07 05:52:26
python标准算法实现数组全排列的方法
2022-03-18 15:11:38
Python selenium 自动化脚本打包成一个exe文件(推荐)
2023-01-13 02:37:39
![](https://img.aspxhome.com/file/2023/9/95339_0s.png)
用python统计代码行的示例(包括空行和注释)
2022-06-28 02:15:30