random script dump
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

seconds-to-hr.py 257B

1234567891011
  1. #!/usr/bin/env python2
  2. from sys import argv
  3. input = int(argv[1])
  4. result = str()
  5. days = input // 86400
  6. hours = input // 3600 % 24
  7. minutes = input // 60 % 60
  8. seconds = input % 60
  9. result = '{}d {}h {}m {}s'.format(days, hours, minutes, seconds)
  10. print(result)