Embarking on your Python journey? If user interaction is on your radar, EasyGUI is a must-learn. This simple yet powerful Python library allows you to create basic graphical user interfaces (GUIs) without needing to learn a separate GUI markup language. Let's dive into this easy and fun tutorial to get you started with EasyGUI in Python.

EasyGUI offers a range of functions to create basic windows with buttons, messages, input boxes, and even simple graphical elements like images. It's perfect for beginners or when you need a quick, no-nonsense way to interact with users.

Getting Started with EasyGUI
First, make sure you have EasyGUI installed. You can do this via pip, Python's package installer, by running: pip install easygui

Now, let's import the library in your Python script: import easygui
Displaying a Simple Message

One of the most basic functions is vrsta = easygui.msgbox('Hello, World!'). This will display a message box with the text 'Hello, World!' and an 'OK' button.
Try altering the text to see how this function works. The return value, in this case, is a message box identifier ('ok', 'cancel', or None), which you can store in a variable as shown above.
Asking for User Input

When you need user input, use username = easygui.enterbox('Please enter your username:'). This will display an input box asking for a username. The user's input is returned as a string.
You can set a default value with def_username = easygui.enterbox('Please enter your username:',默认值 = 'John Doe'). If the user presses 'OK' without changing the input, the default value will be returned.
Creating Interactive Dialogs

EasyGUI allows you to create more complex, multi-choice dialogue boxes with the easygui.ccbox() function, often used for questions or confirmation prompts.
For instance, easygui.ccbox('Are you sure you want to delete these records?', 'Confirm Deletion') will create a dialogue box with the message 'Are you sure you want to delete these records?' and two buttons - 'Yes' and 'No'. The returned value is a boolean: True for 'Yes' and False for 'No'.














![Shortcut to learn Python.[Cheatsheet]](https://i.pinimg.com/originals/59/eb/e1/59ebe1a2022b0681267f600246718995.jpg)



Multichoice Dialogs
If you need a yes/no question with three or more options, use result = easygui.indexbox('Choose:', ['Option 1', 'Option 2', 'Option 3']). This will display a dropdown list with the given options.
The selected option's index (not the option itself) is returned. For example, if 'Option 2' is chosen and the options list is in the order [Option 1, Option 2, Option 3], '1' will be returned.
File Dialogs
EasyGUI also offers file dialogue functions like file_path = easygui.fileopenbox() for opening a file and file_path = easygui.filesavebox() for saving a file.
These return the chosen file's path. If the user presses 'Cancel', None is returned.
That's a wrap! Now that you've dived into the basics of EasyGUI, why not test your newfound skills by creating a simple interactive Python tool? The sky's the limit with your new user interface powers.