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()

效果

相关推荐

  1. Python 48小时速成 4】注释

    2024-04-24 13:18:03       37 阅读
  2. Python 48小时速成 8】函数

    2024-04-24 13:18:03       38 阅读
  3. Python 48小时速成 3】输入与输出

    2024-04-24 13:18:03       44 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-24 13:18:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-24 13:18:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-24 13:18:03       82 阅读
  4. Python语言-面向对象

    2024-04-24 13:18:03       91 阅读

热门阅读

  1. (一)Mysql创建一个博客相关的数据库

    2024-04-24 13:18:03       32 阅读
  2. springboot项目打war包,并且部署外部tomcat中

    2024-04-24 13:18:03       40 阅读
  3. 【Redis】Spring Boot应用中的Redis分布式锁示例

    2024-04-24 13:18:03       35 阅读
  4. windows、Mac如何安装vue开发环境?

    2024-04-24 13:18:03       37 阅读
  5. 在Linux上开启FTP服务

    2024-04-24 13:18:03       38 阅读
  6. LeetCode 344.反转字符串

    2024-04-24 13:18:03       39 阅读
  7. 多服务器上的 docker 实现互相访问

    2024-04-24 13:18:03       32 阅读