PyAutoGUI is a Python module which can automate your GUI and programmatically control your keyboard and mouse. This article illustrates the GUI functions to create display boxes.
If you want to know more about PyAutoGUI and its ability to automate your keyboard and mouse, follow this article : Mouse and Keyboard Automation using PyAutoGUI
PyAutoGUI does not come with python, so go to command prompt and type the following :
pip3 install PyAutoGUI
alert() : Displays a simple message box with text and a single OK button. Returns the text of the button clicked on.
Output : It will display the alert box with the given text and when clicked OK it will return ‘OK’
confirm() : Displays a message box with OK and Cancel buttons. Number and text of buttons can be customized. Returns the text of the button clicked on.
Output : It will display the alert box with the given text and on clicking the button it will return the text on the button. In this case its ‘OK’
To have multiple select options –
Output : On clicking A, it will return ‘A’ as output.
prompt() : Displays a message box with text input, and OK & Cancel buttons. Returns the text entered, or None if Cancel was clicked.
Output : It will return the text entered, in this case ‘GeekForGeeks’ or None if cancelled was clicked.
password() : Displays a message box with text input, and OK & Cancel buttons. Typed characters appear as *. Returns the text entered, or None if Cancel was clicked
Output : It will return the text/password entered, in this case ‘GeekForGeeks’ or None if cancelled was clicked.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python | Message Encode-Decode using Tkinter
- Create a Yes/No Message Box in Python using tkinter
- Send message to Telegram user using Python
- How To Encode And Decode A Message using Python?
- Send Direct Message On Instagram using Selenium in Python
- PyQt5 QSpinBox - Connecting two spin boxes with each other
- PyQt5 - Selecting any one check box among group of check boxes
- Mahotas - Getting Bounding Boxes of Labelled Image
- hmac - Keyed-Hashing for Message Authentication
- Python | Issue Warning Message
- Python | Prompt for Password at Runtime and Termination with Error Message
- Python Program that Sends And Recieves Message from Client
- Python Tkinter - Message
- PyQt5 – Set status bar message in window
- Python PyQt5 – How to change font and size of Status Bar Message
- Python EasyGUI - Message Box
- Python | Create video using multiple images using OpenCV
- Python | Create a stopwatch using clock object in kivy using .kv file
- Circular (Oval like) button using canvas in kivy (using .kv file)
- Image resizing using Seam carving using OpenCV in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.