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.

running.py 443 B

3 years ago
12345678910111213141516
  1. #!/usr/bin/python
  2. #-*- coding: UTF-8 -*-
  3. import time
  4. import datetime
  5. timeStart = datetime.datetime.now()
  6. print(timeStart.strftime('%Y-%m-%d %H:%M:%S'))
  7. for letter in 'Python':
  8. print('当前字母:%s' % letter)
  9. print(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
  10. time.sleep(30)
  11. timeEnd = datetime.datetime.now()
  12. print(timeEnd.strftime('%Y-%m-%d %H:%M:%S'))
  13. print('经历多少秒:%s' % (timeEnd - timeStart).seconds)

No Description