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.

35 lines
1012 B

  1. import tkinter.messagebox as message
  2. import subprocess
  3. import datetime
  4. import os
  5. import webbrowser
  6. from dateutil.parser import parse
  7. # import ctypes
  8. import tkinter as tk
  9. import time
  10. root = tk.Tk()
  11. root.overrideredirect(1)
  12. root.withdraw()
  13. urL='https://drive.google.com'
  14. firefox_path="C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"
  15. webbrowser.register('firefox', None,webbrowser.BackgroundBrowser(firefox_path))
  16. ## Styles:
  17. ## 0 : OK
  18. ## 1 : OK | Cancel
  19. ## 2 : Abort | Retry | Ignore
  20. ## 3 : Yes | No | Cancel
  21. ## 4 : Yes | No
  22. ## 5 : Retry | No
  23. ## 6 : Cancel | Try Again | Continue
  24. t = parse(input("Enter endtime: "))
  25. wait = (t-datetime.datetime.today()).seconds
  26. subprocess.call(['timeout.exe','/nobreak',str(wait)])
  27. subprocess.call(['done.bat'])
  28. subprocess.call(['explorer.exe',os.path.dirname(os.getcwd())])
  29. webbrowser.get('firefox').open_new_tab(urL)
  30. time.sleep(.5)
  31. res = message.askokcancel('Alert!','Upload file and press ok to log off')
  32. if res:
  33. subprocess.call(['shutdown.exe','/f','/l'])