# How to get an Entry box within a Messagebox in Tkinter?

TkinterPythonGUI-Programming

#### Mastering Python GUI with Tkinter

16 Lectures 2 hours

#### GUI Programming with Python Tkinter and Java Swing

30 Lectures 3.5 hours

#### Build A Paint Program With TKinter and Python

24 Lectures 1.5 hours

There are various methods and built-in functions available with the messagebox library in tkinter. Let's assume you want to display a messagebox and take some input from the user in an Entry widget. In this case, you can use the askstring library from simpledialog. The askstring library creates a window that takes two arguments, the title of the window, and the input title before the Entry widget. Let's take an example to understand how it works.

## Example

# Import the required library
from tkinter import *
from tkinter.messagebox import showinfo

# Create an instance of tkinter frame and window
win=Tk()
win.geometry("700x300")

win.mainloop()