from tkinter import *
from tkinter.simpledialog import askstring
class learn():
def __init__(self, root):
self.root=root
self.root.title("Hancie e-Learning Studio")
self.root.geometry("500x400")
def dialog():
prompt = askstring("Input", "Input an String")
print(prompt)
btn=Button(self.root,command=dialog, text="Open dialog")
btn.pack()
if __name__=='__main__':
root=Tk()
learn(root)
root.mainloop()
Output