Advertisement
alekssamos

LinaV2

Nov 27th, 2023
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import sys
  2. import accessible_output2.outputs.auto
  3. import winsound
  4. import keyboard
  5. import time
  6. import os
  7.  
  8. def path_file(file_name):
  9.     if getattr(sys, 'frozen', False):
  10.         return os.path.join(sys._MEIPASS, file_name)
  11.     else:
  12.         return file_name
  13.  
  14.  
  15. def exit():
  16.     speak.output(str(count))
  17.     sys.exit(0)
  18.  
  19. def reset_seconds(*args, **kwargs):
  20.     global seconds
  21.     seconds = 0
  22.  
  23.  
  24. count = 0
  25. seconds=0
  26. speak = accessible_output2.outputs.auto.Auto()
  27. keyboard.add_hotkey("ctrl+shift+/", exit)
  28. keyboard.on_press(reset_seconds)
  29.  
  30. while True:
  31.     time.sleep(1)
  32.     seconds+=1
  33.     if seconds % 300 == 0:
  34.         count += 1
  35.         winsound.PlaySound(path_file("snd"), winsound.SND_FILENAME)
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement