How to Display Alert Message using Python
You can display the alert message with just 2 lines of python code. Let’s move on to an awesome project. Before getting into this, we will have a python interpreter andPyAutoGUI packages. In this case, I will use pycharm IDE. How to install pycharm in windows: https://iterathon.tech//how-to-install-the-pycharm-in-windows/
Open New Projects
After opening a pycharm click on a new project and you can give it any name as an alert message. In this project.
Once you have give the name and click on the create. It takes few seconds to create the project, In the current project (alert message) there are some existing files are found in IDE so, delete all those files using Ctrl+A and Backspace. Now Python is ready to code before that we need one awesome python packages called PyAutoGUI.
Install PyautoGUI
Pyautogui is a library that allows you to control the mouse, keyboard as well as allows you to do various tasks.
Link to PyAutoGUI package: https://pypi.org/project/PyAutoGUI/. After getting into the link. You need to copy the magical word to install pyAutoGUI. That is pip install PyAutoGUI.
Again go to the pycharm and click terminal then paste the magical word pip install PyAutoGUI. It takes few seconds to install packages. Once the package gets installed and then go to your project alert message.
Code
This is an easy and crazy python project to display alerts messages. Let’s further move on to the python program.
# python code for display alert messages import pyautogui pyautogui.alert("Always be with Iterathon") #Output
Therefore, you run this code, the alert message pops up in the center of the window. then click ok. finally, that popup box get disappears. Suppose if you give more than one alert message, it will execute one by one.
Related Blogs
How to Create a Data Visualization in Python: https://iterathon.tech//how-to-create-a-data-visualization-in-python/
How to Impress a girl’s heart using python heart: https://iterathon.tech//how-to-impress-a-girlfriend-heart-using-python/
Random Password Generator in Python: https://iterathon.tech//random-password-generator-in-python/
LEARN SOMETHING NEW ❣