1.初始设置 |
from datetime import*#导入相关库 from turtle import* from time import sleep setup(675,675)#设置窗口大小 hideturtle()#隐藏海龟 mode("logo")#设置模式 |
2.读取时间 |
while(True):#重复执行 hideturtle()#隐藏海龟 curr=datetime.now()#读取时间 year=curr.year month=curr.month day=curr.day hour=curr.hour minute=curr.minute second=curr.second |
Python编写时钟程序(运行结果在“视频“选项里)(适合学过编程2年00个月~2年11个月的人(中级篇))
于 2022-10-02 14:13:57 首次发布