LoginSignup
2
3

PythonでPC用通知システムを作る

Last updated at Posted at 2024-05-11

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と連携することで、独自通知システムが可能になる。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3