这篇文章主要为大家详细介绍了python3实现表白神器,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
本文实例为大家分享了使用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.hi来源gao@dai!ma.com搞$代^码网deturtle() # 隐藏画笔(先) 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
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持gaodaima搞代码网。
以上就是python3实现表白神器的详细内容,更多请关注gaodaima搞代码网其它相关文章!