12345678910111213141516171819 |
- import platform, os
-
- def push(title, message):
- plt = platform.system()
- if plt == "Darwin":
- command = '''
- osascript -e 'display notification "{message}" with title "{title}"'
- '''
- elif plt == "Linux":
- command = f'''
- notify-send "{title}" "{message}"
- '''
- elif plt == "Windows":
- win10toast.ToastNotifier().show_toast(title, message)
- return
- else:
- return
- os.system(command)
|