Latest web development tutorials

Python incluye ejercicios 10

Python 100 Li Python 100 Li

Título: segunda salida pausa.

Análisis del programa: Ninguno.

Código fuente:

#!/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()))

La salida del ejemplo anterior es:

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

Python 100 Li Python 100 Li