Python 如何防止win10Toast通知消失?

Python 如何防止win10Toast通知消失?,python,python-3.x,windows,Python,Python 3.x,Windows,我想通过python向windows发送一些重要消息的通知。我尝试了win10Toast,但程序完成后通知消失 我的代码是: ## program to generate a simple toast notifier from win10toast import ToastNotifier ## instantiating the class n = ToastNotifier() n.show_toast("Test Message","Notification body",duration

我想通过python向windows发送一些重要消息的通知。我尝试了
win10Toast
,但程序完成后通知消失

我的代码是:

## program to generate a simple toast notifier
from win10toast import ToastNotifier
## instantiating the class
n = ToastNotifier()
n.show_toast("Test Message","Notification body",duration=15)`
只要我的程序还在运行,它就会正常运行,但在程序完成后它就会消失。我想在系统托盘中显示此消息,直到用户丢弃此消息

第二,你能告诉我如何查看通知历史记录吗


我正在使用Python 3.7和Windows 10更改“duration=15”表示“duration=None”

更改“duration=15”表示“duration=None”

有一个名为win10toast\u persist的库,它是win10toast的分支。您可以使用
pip install win10toast persist安装它
Ok,谢谢,我会检查是否有一个名为win10toast\u persist的库,它是win10toast的分支。您可以使用
pip install win10toast persist安装它
Ok,谢谢,我将检查从win10toast导入到stnotifier###实例化类n=toast notifier()n.show_toast(“测试消息”,“通知正文”,持续时间=None)它给出以下错误消息类型错误:需要一个整数(get type NoneType)从win10toast导入ToastNotifier##实例化类n=ToastNotifier()n.show_toast(“测试消息”,“通知正文”,持续时间=None),它给出以下错误消息TypeError:需要一个整数(Get type NoneType)