Working in bioinformatics can be seen as an infinite loop of: think, write a script, run script, analyze data. While I work on a Mac, most of the scripts run on a Linux server, and it would be nice to know when a script is done so that I can look at the data. In order to be notified when a script finishes, I now use Growl (see picture).
I downloaded netgrowl.py and wrote a quick and dirty wrapper package around it:
from netgrowl import *
def growlNotify(title = "Script Finished", message = ""):
addr = ("10.1.104.26", GROWL_UDP_PORT)
s = socket(AF_INET,SOCK_DGRAM)
# p = GrowlRegistrationPacket(application="Network Demo", password="?")
# p.addNotification("Script Finished", enabled=True)
# s.sendto(p.payload(), addr)
if not message:
message = sys.argv
p = GrowlNotificationPacket(application="Network Demo",
notification="Script Finished", title=title,
if __name__ == '__main__':
The registration is hidden in a comment, you only need to do that the very first time. So, in my scripts, I just insert the following right before the end of the script (using a Textmate snippet to save typing).