Send a desktop notification using Python

As an Amazon Associate I earn from qualifying purchases.

2 Min Read

To send a notification to your desktop using Python, you will need to install the following library: Plyer.

Plyer is a Python library for accessing features of your hardware/platforms.

Install Plyer using the following command:

pip install plyer

Open a new Python file and start by importing notification from plyer:

from plyer import notification

On the next line call notification.notify specifying the title of your notification, the message and how long you want the notification to display for (timeout):

	title = "Hello World!", 
	message= "My test msg!", 
	# displaying time 

When you run this Python script, you should be able to see your notification on screen:

That’s it for how to Send a desktop notification using Python

If you’re interested in learning Python I highly recommend this book. In the first half of the book, you”ll learn basic programming concepts, such as variables, lists, classes, and loops, and practice writing clean code with exercises for each topic. In the second half, you”ll put your new knowledge into practice with three substantial projects: a Space Invaders-inspired arcade game, a set of data visualizations with Python”s handy libraries, and a simple web app you can deploy online. Get it here.

Interested in creating your own algo trading bot? Check out my free series on algo trading here:

As always, if you have any questions or comments please feel free to post them below. Additionally, if you run into any issues please let me know.

Leave a Comment

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

Subscribe to my newsletter to keep up to date with my latest posts

Holler Box