100-010

暂停一秒输出,并格式化当前时间。
方法一:
 1 #! /usr/bin/env python
 2 # -*- coding:utf-8 -*-
 3 '''暂停一秒输出,并格式化当前时间。'''
 4 
 5 import time
 6 
 7 print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
 8 # 暂停一秒
 9 time.sleep(1)
10 print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))

 

posted @ 2018-04-04 06:21  睡到自然醒的猪  阅读(167)  评论(0)    收藏  举报

iaoexl at outlook dot com, 返回顶部 →友情链接: 信息港 同城信息