Created
April 23, 2020 08:11
-
-
Save elowy01/45af75a2fdb4656e1b9858b32b635953 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, install the following module: | |
$ [sudo] gem install terminal-notifier | |
# And write code: | |
import os | |
# The notifier function | |
def notify(title, subtitle, message): | |
t = '-title {!r}'.format(title) | |
s = '-subtitle {!r}'.format(subtitle) | |
m = '-message {!r}'.format(message) | |
os.system('terminal-notifier {}'.format(' '.join([m, t, s]))) | |
# Calling the function | |
notify(title = 'A Real Notification', | |
subtitle = 'with python', | |
message = 'Hello, this is me, notifying you!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment