问题
I would like to create a simple toast notification using python v3.6 on Windows10 machine.
I am using this python library.
https://github.com/jithurjacob/Windows-10-Toast-Notifications/
I ran the code below;
from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Hello World!!!",
"Python is awsm by default!")
All I get is an icon appearing at the bottom right. I don't see any message popping out. What are some possible things that can go wrong?
Are there some configuration settings in Windows 10 that disabled the python toast notification?
The screenshot below shows the tiny python icon at the bottom row that appears when I run the python code. I don't see any message such as Hello World!!!","Python is awsm by default!
appearing. When my mouse pointer hover over the python icon, I see the word tooltip
appearing.
Here is my notification settings on Windows 10.
回答1:
I discovered the solution to my question. The toast notifications have been suppressed by Windows 10 Action Center. At the bottom right corner, click the Action Center icon. For my PC, the "Quiet Hours" setting was turned on. After I disable "Quiet Hours", toast notifications can appear.
The python library win10toast
works perfectly fine after Action Center settings are correctly set.
来源:https://stackoverflow.com/questions/45755475/why-is-this-simple-python-toast-notification-not-working