5

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.

enter image description here

Here is my notification settings on Windows 10.

enter image description here

12
  • 1
    Could you share a screen capture of what you are saying? Commented Aug 18, 2017 at 11:41
  • 3
    Hi I'm the author of this library could you please share a screenshot? Commented Aug 18, 2017 at 12:33
  • @Jithu R Jacob, it is an honour to see you on my question. I'm sure it is my fault but I don't know what went wrong. I have attached a sceenshot to my question. Commented Aug 18, 2017 at 12:48
  • 1
    Can you please confirm if notifications are enabled in your system? thewindowsclub.com/toast-notifications-windows-8 Commented Aug 18, 2017 at 13:01
  • 1
    @user781486 thank you Commented Aug 22, 2017 at 5:35

4 Answers 4

13

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.

Sign up to request clarification or add additional context in comments.

Comments

1

I think there is a little mistake in your code. You started the "Python is awsm by default!" text into a new line, but as I remember, if you want to continue the code in the following line, you need to put a backslash to the end of the first line. I also noticed some smaller differences. I know this is hard to understand, so I show you what I am thinking of.

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

Comments

0

go to bottom right, click action center, now click at the top right corner where it says manage notifications, now enable the button under the title 'Notifications' if it is disabled and probably because of this reason win10toast was unable to perform the desired task. and now it works absolutely! :) Thank you!

Comments

0

plyer (for creating notifications on your PC)

   pip install plyer

creating custom notification

from plyer import notification #for getting notification on your PC
notification.notify(
        #title of the notification,
        title = "COVID19 Stats",
        #the body of the notification
        message = "Total cases :",  
        #creating icon for the notification
        #we need to download a icon of ico file format
        app_icon = "Paomedia-Small-N-Flat-Bell.ico",
        # the notification stays for 50sec
        timeout  = 50
    )

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.