gpt4 book ai didi

python - 为什么这个简单的 python toast 通知不起作用?

转载 作者:太空宇宙 更新时间:2023-11-03 14:51:09 24 4
gpt4 key购买 nike

我想在 Windows10 机器上使用 python v3.6 创建一个简单的 toast 通知。

我正在使用这个 python 库。

https://github.com/jithurjacob/Windows-10-Toast-Notifications/

我运行了下面的代码;

 from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Hello World!!!",
"Python is awsm by default!")

我得到的只是一个出现在右下角的图标。我没有看到任何消息弹出。有哪些可能出错的地方?

Windows 10 中是否有一些配置设置禁用了 python toast 通知?

下面的屏幕截图显示了当我运行 python 代码时出现在底行的小 python 图标。我没有看到任何消息,例如 Hello World!!!","Python 默认为 awsm! 出现。当我的鼠标指针悬停在 python 图标上时,我看到 tooltip 出现了。

enter image description here

这是我在 Windows 10 上的通知设置。

enter image description here

最佳答案

我找到了问题的解决方案。 Toast 通知已被 Windows 10 操作中心抑制。在右下角,单击“操作中心”图标。对于我的 PC,“安静时间”设置已打开。在我禁用“Quiet Hours”后,可以出现 toast 通知。

正确设置操作中心设置后,python 库 win10toast 可以正常工作。

关于python - 为什么这个简单的 python toast 通知不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45755475/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com