SHARE
TWEET

Untitled

a guest Aug 14th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import win32gui
  2. import win32api
  3. import os
  4.  
  5. import sys
  6. import time
  7.  
  8. ###Virtual-KeyCodes###
  9. Media_Next = 0xB0
  10. Media_Previous = 0xB1
  11. Media_Pause = 0xB3 ##Play/Pause
  12. Media_Mute = 0xAD
  13.  
  14. ###Media Controls###
  15. def hwcode(Media):
  16.     hwcode = win32api.MapVirtualKey(Media, 0)
  17.     return hwcode
  18.    
  19. def pause():
  20.     win32api.keybd_event(Media_Pause, hwcode(Media_Pause))
  21.  
  22.  
  23. if __name__ == "__main__":
  24.     print('counting', sys.argv[1])
  25.  
  26.     for i in range(0, int(sys.argv[1])):
  27.         time.sleep(60)
  28.         print(f"Time Elapsed: {i+1}")
  29.     pause()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top