admin管理员组

文章数量:1655350

Python 触发 Windows 通知需要使用第三方库,在这里我使用的是 win10toast。
安装库(注:要求安装pywin32):pip install win10toast

示例:

from win10toast import ToastNotifier

toaster = ToastNotifier()
toaster.show_toast(u'标题', u'收到一个通知')

Syntax: show_toast(title=’Notification’, message=’Here comes the message’, icon_path=None, duration=5, threaded=False)
Parameters:
title: It contains notification title.
message: It contains notification message.
icon_path: It contains the path to .ico file.
duration“: It specifies the notification destruction active duration.

库win10toast 在 GitHub 的地址:https://github/jithurjacob/Windows-10-Toast-Notifications

本文标签: 通知Python