当前位置:网站首页>实例010:给人看的时间
实例010:给人看的时间
2022-07-05 08:16:00 【懒笑翻】
题目内容
#### 实例010:给人看的时间 # **题目:**暂停一秒输出,并格式化当前时间。
问题分析
还是用到time()函数
%Y Year with century as a decimal number.年 %m Month as a decimal number [01,12].月 %d Day of the month as a decimal number [01,31].日 %H Hour (24-hour clock) as a decimal number [00,23].时 %M Minute as a decimal number [00,59].分 %S Second as a decimal number [00,61].秒 %z Time zone offset from UTC. %a Locale's abbreviated weekday name. %A Locale's full weekday name. %b Locale's abbreviated month name. %B Locale's full month name. %c Locale's appropriate date and time representation. %I Hour (12-hour clock) as a decimal number [01,12]. %p Locale's equivalent of either AM or PM.
程序
import time
for i in range(4):
print(time.strftime('%H:%M:%S', time.localtime(time.time())))
time.sleep(1)
import time
for i in range(4):
print(time.strftime('%H:%M:%S'))
time.sleep(1)
结果:
边栏推荐
- Shape template matching based on Halcon learning [9] PM_ multiple_ dxf_ models. Hdev routine -- [read and write XLD from DXF file]
- Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
- OC and OD gate circuit
- Consul安装
- Halcon's practice based on shape template matching [1]
- UEFI development learning 5 - simple use of protocol
- C # joint configuration with Halcon
- Create inf module in AMI code
- matlab timeserise
- MySQL MHA high availability cluster
猜你喜欢
Let's briefly talk about the chips commonly used in mobile phones - OVP chips
Process communication mode between different hosts -- socket
Stablq of linked list
[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication
H264 (I) i/p/b frame gop/idr/ and other parameters
Network communication process
Explain task scheduling based on Cortex-M3 in detail (Part 2)
STM32 virtualization environment of QEMU
Network communication model -- Network OSI tcp/ip layering
Management and use of DokuWiki
随机推荐
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
Circleq of linked list
QEMU demo makefile analysis
[trio basic from introduction to mastery tutorial 20] trio calculates the arc center and radius through three points of spatial arc
Interview catalogue
Shell script realizes the reading of serial port and the parsing of message
Gradle composite construction
Imx6ull bare metal development learning 1-assembly lit LED
Buildroot system for making raspberry pie cm3
Volatile of C language
Sql Server的存儲過程詳解
Fundamentals of C language
C WinForm [change the position of the form after running] - Practical Exercise 4
Keil use details -- magic wand
C language enhancement -- pointer
UE像素流,来颗“减肥药”吧!
The firmware of the connected j-link does not support the following memory access
Some thoughts on extracting perspectives from ealfa and Ebeta
Halcon's practice based on shape template matching [1]
My-basic application 1: introduction to my-basic parser