# 暂停一秒输出,并格式化当前时间。
# 暂停一秒输出,并格式化当前时间。
1 import time 2 print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))) 3 time.sleep(1) 4 print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# 暂停一秒输出,并格式化当前时间。
1 import time 2 print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))) 3 time.sleep(1) 4 print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))