push.py 469 B

12345678910111213141516171819
  1. import platform, os
  2. def push(title, message):
  3. plt = platform.system()
  4. if plt == "Darwin":
  5. command = '''
  6. osascript -e 'display notification "{message}" with title "{title}"'
  7. '''
  8. elif plt == "Linux":
  9. command = f'''
  10. notify-send "{title}" "{message}"
  11. '''
  12. elif plt == "Windows":
  13. win10toast.ToastNotifier().show_toast(title, message)
  14. return
  15. else:
  16. return
  17. os.system(command)