Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. import datetime, pygame
  2.  
  3. pygame.init()
  4. secondtick = pygame.time.Clock()
  5.  
  6. timestr = str(datetime.datetime.now().time())
  7.  
  8. timelist = list(timestr)
  9.  
  10. timex = 1
  11. while timex <= 6:
  12. timelist.pop(0)
  13. timex += 1
  14. timex2 = 1
  15.  
  16. while timex2 <= 7:
  17. timelist.pop(2)
  18. timex2 += 1
  19. secondstr1 = str("".join(timelist))
  20.  
  21. while 1:
  22. timestr = str(datetime.datetime.now().time())
  23.  
  24. timelist = list(timestr)
  25.  
  26. timex = 1
  27. while timex <= 6:
  28. timelist.pop(0)
  29. timex += 1
  30. timex2 = 1
  31. while timex2 <= 7:
  32. timelist.pop(2)
  33. timex2 += 1
  34.  
  35. secondstr2 = str("".join(timelist))
  36.  
  37. x = 1
  38.  
  39. if int(secondstr2) - x == int(secondstr1):
  40. print(x)
  41. x += 1
  42.  
  43. C:Python32python.exe "C:/Users/depia/PycharmProjects/testing/test.py"
  44. Traceback (most recent call last):
  45. File "C:/Users/depia/PycharmProjects/testing/test.py", line 31, in <module>
  46. timelist.pop(2)
  47. IndexError: pop index out of range
  48.  
  49. Process finished with exit code 1
  50.  
  51. -- code --
  52. time.sleep(1)
  53. secondstr2 = str("".join(timelist))
  54. -- more code --
  55.  
  56. C:Python32python.exe "C:/Users/depia/PycharmProjects/testing/test.py"
  57. 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement