As an Amazon Associate I earn from qualifying purchases.
To send a notification to your desktop using Python, you will need to install the following library:
Plyer is a Python library for accessing features of your hardware/platforms.
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):
notification.notify( title = "Hello World!", message= "My test msg!", # displaying time timeout=10 )
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: https://www.conorjohanlon.com/category/algotrader/
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.