当前位置:网站首页>Example 010: time to show
Example 010: time to show
2022-07-05 08:22:00 【Lazy smile】
Topic content
#### example 010: Time to show # ** subject :** Pause output for one second , And format the current time .
Problem analysis
Still use time() function
%Y Year with century as a decimal number. year %m Month as a decimal number [01,12]. month %d Day of the month as a decimal number [01,31]. Japan %H Hour (24-hour clock) as a decimal number [00,23]. when %M Minute as a decimal number [00,59]. branch %S Second as a decimal number [00,61]. second %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.
Program
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)
result :
边栏推荐
- Explain task scheduling based on Cortex-M3 in detail (Part 2)
- Array integration initialization (C language)
- Naming rules for FreeRTOS
- My-basic application 1: introduction to my-basic parser
- Detailed summary of FIO test hard disk performance parameters and examples (with source code)
- Carrier period, electrical speed, carrier period variation
- Classic application of MOS transistor circuit design (2) - switch circuit design
- Some thoughts on extracting perspectives from ealfa and Ebeta
- Halcon's practice based on shape template matching [1]
- Stm32--- systick timer
猜你喜欢
Various types of questions judged by prime numbers within 100 (C language)
Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
实例001:数字组合 有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
C WinForm [view status bar -- statusstrip] - Practice 2
Halcon's practice based on shape template matching [2]
STM32 virtualization environment of QEMU
Classic application of MOS transistor circuit design (1) -iic bidirectional level shift
[three tier architecture and JDBC summary]
Why is 1900 not a leap year
Negative pressure generation of buck-boost circuit
随机推荐
Nb-iot technical summary
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
[nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)
Semiconductor devices (III) FET
What are the test items of power battery ul2580
Carrier period, electrical speed, carrier period variation
STM32 virtualization environment of QEMU
STM32 --- configuration of external interrupt
Explain task scheduling based on Cortex-M3 in detail (Part 1)
Stm32--- systick timer
PMSM dead time compensation
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
Hardware 1 -- relationship between gain and magnification
实例006:斐波那契数列
Detailed summary of FIO test hard disk performance parameters and examples (with source code)
99 multiplication table (C language)
VESC Benjamin test motor parameters
Live555 push RTSP audio and video stream summary (III) flower screen problem caused by pushing H264 real-time stream
【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
Hardware and software solution of FPGA key chattering elimination