plyer - Desktop Notification with Python

Desktop notifiaction with Python
python
Author

noklam

Published

October 19, 2019

from plyer import notification
import random

class DesktopNotification:
    @staticmethod
    def notify(title='Hey~', message='Done!', timeout=10):
        ls = ['👍','✔','✌','👌','👍','😎']
        notification.notify(
            title = title ,
            message = random.choice(ls) * 3 + ' ' + message,
            timeout = timeout # seconds
        )


if __name__ == '__main__':
    DesktopNotification.notify()

You could add this simple code block to notify you when the program is done! A desktop notification will be prompt on the bottom right corner in Window.