You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/usr/bin/python
- #-*- coding: UTF-8 -*-
- import time
- import datetime
-
- timeStart = datetime.datetime.now()
- print(timeStart.strftime('%Y-%m-%d %H:%M:%S'))
- for letter in 'Python':
- print('当前字母:%s' % letter)
- print(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
- time.sleep(30)
-
-
- timeEnd = datetime.datetime.now()
- print(timeEnd.strftime('%Y-%m-%d %H:%M:%S'))
- print('经历多少秒:%s' % (timeEnd - timeStart).seconds)
|