PC用通知システム
notify-pyライブラリを使うことでPC用の通知システムが簡単に作れます。
pip install notify-py
でライブラリをインストールできる
テストコード(Linux用)
ntf
#!/usr/bin/python3
from notifypy import Notify
# 通知オブジェクトを作る
n=Notify()
# 何も操作しなければ通知エリアにメッセージが残るように設定
n.urgency="normal"
# メッセージタイトル
n.title="テスト通知"
# メッセージ
n.message="メッセージテスト"
# 通知送信
n.send()
# この他にも、アイコンや音 等も設定できる。
このファイルに実行権をつけてください。
応用
外部データベースやAPIと連携することで、独自通知システムが可能になる。