Latest web development tutorials

Python includes exercises 10

Python 100 Li Python 100 Li

Title: second pause output.

Program Analysis: None.

Source Code:

#!/usr/bin/python
# -*- coding: UTF-8 -*-
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()))

The above example output is:

2015-10-21 17:48:40
2015-10-21 17:48:41

Python 100 Li Python 100 Li