Install win10toast via pip
masterInstall the library using pip to enable Windows 10 Toast Notifications in your Python applications.
pip install win10toastrepository·master·Indexed 21 days ago
https://github.com/jithurjacob/windows-10-toast-notificationsA lightweight Python library for displaying Windows 10 Toast Notifications. It provides the ToastNotifier class to trigger notifications with customizable titles, messages, icons, and durations, supporting both synchronous and threaded execution.
Install the library using pip to enable Windows 10 Toast Notifications in your Python applications.
pip install win10toastpypiwin32 and setuptools to function correctly. Ensure these are installed in your environment.pypiwin32
setuptoolsBy setting threaded=True in show_toast(), the notification will run in its own thread, allowing your main application to continue executing. To prevent the application from exiting before the notification is finished, use toaster.notification_active() in a loop to poll the status.
import time
from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Example two",
"This notification is in it's own thread!",
icon_path=None,
duration=5,
threaded=True)
# Wait for threaded notification to finish
while toaster.notification_active():
time.sleep(0.1)Use the ToastNotifier class to trigger notifications. You can specify the title, message, an optional icon path, and the duration the notification remains visible.
from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Hello World!!!",
"Python is 10 seconds awsm!",
icon_path="custom.ico",
duration=10)