BUG-Fly BUG-Fly
  • 首页
  • BUG-EXP
  • 编程开发
  • 电脑评测
  • 生活分享
  • 友情链接
  • Fly全站协议声明
首页 › Python › 我爱你Python——情人节快乐

我爱你Python——情人节快乐

BUG-Fly
5 年前

今天是2月14日,嗯,这是一个单身贵族的节日!从昨晚12点到现在朋友圈,空间一直都在秀。

你说秀就秀吧,我还发现竟然有秀重复的,嗯,你们都懂得!这也太休了吧!!!!

好友们都在秀,我呢?我当然不是一个人!,我的TA都陪我走过快两年的时光了,这两年我们互相学习,互相进步!

下面请允许我介绍我的TA,我的小乖乖:

Python

没错,就是这个磨人的小可爱!

import turtle
import time

def LittleHeart():
    for i in range(200):
        turtle.right(1)
        turtle.forward(2)


love = input('主人请输入表白语句:"I Love you": ')

lover = input('主人请输入对方的姓名或昵称: ')
if love == '':
    love = 'I Love you'
# 窗口大小
turtle.setup(width=800, height=500)
# 颜色
turtle.color('red', 'pink')
# 笔粗细
turtle.pensize(5)
# 速度
turtle.speed(1)
# 提笔
turtle.up()
# 隐藏笔
turtle.hideturtle()
# 去到的坐标,窗口中心为0,0
turtle.goto(0, -180)
turtle.showturtle()
# 画上线
turtle.down()
turtle.speed(1)
turtle.begin_fill()
turtle.left(140)
turtle.forward(224)

LittleHeart()

turtle.left(120)
LittleHeart()

turtle.forward(224)
turtle.end_fill()
turtle.pensize(5)
turtle.up()
turtle.hideturtle()
# 在心中写字 一次
turtle.goto(0, 0)
turtle.showturtle()
turtle.color('#CD5C5C', 'pink')
# 在心中写字
turtle.write(love, font=('S2G love', 30,), align="center")
turtle.up()
turtle.hideturtle()
time.sleep(2)
# 在心中写字 二次
turtle.goto(0, 0)
turtle.showturtle()
turtle.color('red', 'pink')
turtle.write(love, font=('S2G love', 30,), align="center")
turtle.up()
turtle.hideturtle()

if lover != '':
    turtle.color('black', 'pink')
    time.sleep(2)
    turtle.goto(180, -180)
    turtle.showturtle()
    turtle.write(lover, font=('桃心心形字体',25,), align="center", move=True)
 

window = turtle.Screen()
window.exitonclick()

小可爱,情人节快乐!

我爱你Python——情人节快乐-BUG-Fly
Python
7
0
BUG-Fly
写BUG飞起的Coder
Python网络爬虫实战——爬取猫眼TOP100
上一篇
Python 中的库、模块、包,你还傻傻分不清楚吗?
下一篇

评论 (0)

请登录以参与评论
现在登录
    发表评论

猜你喜欢

  • 如何优雅地在 Chrome Headless 模式下触发网站的 favicon 请求
  • Python 函数
  • Python内置数据结构——列表(list)
  • Python基础语法

词云

2020 (1) Flask (1) Go (1) JS逆向 (1) Linux (1) Playwright (1) PySide2开发 (1) Python (13) Python实战项目 (5) 固原一中 (1) 国庆70周年 (1) 开源 (1) 数据结构和算法 (2) 数组 (1) 新年贺词 (1) 新月诗刊社 (3) 电脑评测 (3) 软件教程 (3) 雨雯公益 (1) 音乐 (3)

BUG-Fly

写BUG飞起的Coder
34
文章
5
评论
324
获赞
  • 首页
  • 友情链接
Copyright © 2019-08-20-2025 BUG-Fly. Designed by BUG-Fly.

Fly小站已经运行:

津ICP备19007312号
技术基佬基地: KRUNK ZHOU Legna 科技
  • Python13
  • Python实战项目5
  • 新月诗刊社3
  • 音乐3
  • 电脑评测3
  • 首页
  • BUG-EXP
  • 编程开发
  • 电脑评测
  • 生活分享
  • 友情链接
  • Fly全站协议声明