The package is available in Pypi and installed using pip.
pip install win10toast
About the show_toast ()
function:
Syntax: show_toast (title = ’Notification’, message = ’Here comes the message’, icon_path = None, duration = 5, threaded = False)
Parameters:
title : It contains notification title.
message : It contains notification message.
icon_path : It contains the path to .ico file.
duration ": It specifies the notification destruction active duration.
To create notifications, we have to import the win10toast module. Then create an object for the ToastNotifier
class and using the show_toast
method we will create a notification. It contains the title or title of this notification, the actual message, the duration of that notification, and an icon for that notification. The show_toast
method is an instance of the notification settings.
Code # 1:
|
Output:
Code # 2:
|
Output: