python3 练习题100例 (八)

题目八:暂停一秒输出,并格式化当前时间。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

""" 题目八:暂停一秒输出,并格式化当前时间。"""

__author__ = 'Fan Lijun'

import time

print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))

# 暂停一秒
time.sleep(1)

print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))

  

posted on 2018-11-05 09:45  daxia5398  阅读(212)  评论(0编辑  收藏  举报

导航