Drkcore

29 10 2010 Python Tweet

プレゼン用にGrowl通知するタイマーを作った

今日の朝、時計をもっていないことに気づいて。

import sys,os
import Growl
import threading

def timenotify(notify_string):
    image = Growl.Image.imageFromPath("/Users/kzfm/.tw_growl/kzfm.png")
    g = Growl.GrowlNotifier(applicationName='Timer', notifications=['Watch'])
    g.register()
    g.notify(
        noteType='Watch', 
        title="GrowlTimer", 
        description= notify_string,
        icon=image,
        sticky=False)

if __name__ == "__main__":
    t1 = threading.Timer(600, timenotify, args=["10分経過しました"])
    t2 = threading.Timer(1200, timenotify, args=["20分経過しました"])
    t3 = threading.Timer(1500, timenotify, args=["25分経過しました。そろそろまとめ"])
    t4 = threading.Timer(1800, timenotify, args=["30分経過しました。発表終了"])
    t1.start()
    t2.start()
    t3.start()
    t4.start()

やっつけスクリプト

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021