python简易小时钟

python 复制代码
import time
import turtle


def getTime():
    tt = time.localtime()  # 结构化的时间
    ss = time.strftime('%Y年%m月%d日 %H:%M:%S', tt)
    return ss


pen = turtle.Turtle()

pen.backward(100)
pen.speed(0)

while True:
    time.sleep(1)
    times = getTime()
    pen.clear()
    pen.write(times, font=("Arial", 40, "normal"))

input()

效果

相关推荐
前端Hardy5 分钟前
Python 打造 Excel 到 JSON 转换工具:从开发到打包全攻略
前端·后端·python
打码农的篮球9 分钟前
C++模板
开发语言·c++
荔枝吻24 分钟前
【保姆级喂饭教程】Python依赖管理工具大全:Virtualenv、venv、Pipenv、Poetry、pdm、Rye、UV、Conda、Pixi等
python·uv·环境管理
mortimer36 分钟前
从 `__init__` 的重复劳动中解放出来:使用 dataclass 重构简化python
python
小乖兽技术41 分钟前
在 .NET 中使用 Base64 时容易踩的坑总结
开发语言·c#·.net
Blossom.1181 小时前
基于深度学习的图像分类:使用ShuffleNet实现高效分类
人工智能·python·深度学习·目标检测·机器学习·分类·数据挖掘
Lenyiin1 小时前
《LeetCode 热题 100》整整 100 题量大管饱题解套餐 中
java·c++·python·leetcode·面试·刷题·lenyiin
WJ.Polar1 小时前
Python与Mysql
开发语言·数据库·python·mysql
pk_xz1234561 小时前
社区资源媒体管理系统设计与实现
网络·python·深度学习·算法·数据挖掘·媒体
边疆.2 小时前
【C语言】文件操作
c语言·开发语言·文件操作