Skip to content

Instantly share code, notes, and snippets.

View baliw's full-sized avatar

Daniel Walton baliw

View GitHub Profile
@baliw
baliw / mlnotifications.py
Created November 5, 2012 21:53
Mountain Lion Notification Center via Python
import Foundation
import objc
import AppKit
import sys
NSUserNotification = objc.lookUpClass('NSUserNotification')
NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')
def notify(title, subtitle, info_text, delay=0, sound=False, userInfo={}):
notification = NSUserNotification.alloc().init()