Python Toast Notifaction not working on No GUI

Here is the code for the toast notification:

from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Test Python", "Python Test!")

When I run the program normally: python .fileName.py, I get the notification and everything is good.

However, if I run the program wihtout GUI: pythonw .fileName.py, I don’t see a notification. However, I can see that the program is running here:

enter image description here

But again I don’t actually get a notification pop up. I’m not sure why, it may be a Windows10 system setting or something, not sure. How do I get the notification to show up when I’m running the python file in the background?

Answer

Oh I had a similar issue, You need to go into windows setting -> Notifications and action. And basically check everything. If that doesn’t work, open the side menu on windows, then turn off focus assist. Focus assist is basically “do not disturb”. If you turn that off, windows won’t block your notification!

Leave a Reply

Your email address will not be published. Required fields are marked *