Using python I am wanting to post a message to the OSX Notification Center. What library do I need to use? should i write a program in objective-c and then call that progra
Try ntfy if you also want the script to be able to communicate with you over other devices.
[sudo] pip install ntfy
where pip
refers to the Package Installer of the target Python version
For Python3 installation:
[sudo] pip3 install ntfy
I use this simple function for notifications regarding command executions and download completions:
def notification(title, message):
"""Notifies the logged in user about the download completion."""
import os
cmd = 'ntfy -t {0} send {1}'.format(title, message)
os.system(cmd)
notification("Download Complete", "Mr.RobotS01E05.mkv saved at /path")
This tool is quite handy as it logs all the notifications directly to the Notification Center rather than referring to other third-party application.
Multiple Backend supports: This tool can connect to you over any device through services such as PushBullet, SimplePush, Slack, Telegram etc. Check the entire list of supported backend services here.