utils.py 713 B

123456789101112131415161718192021222324252627282930
  1. '''
  2. Created on Jan 28, 2020
  3. @author: levente.marton
  4. '''
  5. import pyautogui as gui
  6. import pywinctl as gw
  7. from datetime import date, timedelta # datetime as dt
  8. def last_day_of_month(any_day=date.today):
  9. next_month = any_day().replace(day=28) + timedelta(days=4)
  10. return next_month - timedelta(days=next_month.day)
  11. def _printer(func):
  12. def wrapper():
  13. print(func.__doc__, 'h_key performed')
  14. return func()
  15. return wrapper
  16. def mv_mouse_right():
  17. size = gui.size()
  18. gui.moveTo(size[0] / 1.01, size[1] / 1.01)
  19. def mv_mouse_cent():
  20. size = gui.size()
  21. gui.moveTo(size[0] / 2, size[1] / 2)
  22. if __name__ == '__main__':
  23. print(gw.getAllTitles())