I am trying to display a popup message in tkinter but I don't know why it's not showing in the window. Here is my code :
def popupmsg(msg):
popup = tk.Tk()
popup.wm_title("Results ")
data_string = tk.StringVar()
data_string.set(msg)
ent = tk.Entry(popup, textvariable=data_string, fg="black", bg="white", bd=0, state="readonly")
ent.pack(side="top", fill="x", pady=10)
B1 = tk.Button(popup, text="Okay", command=popup.destroy)
B1.pack()
popup.mainloop()
This is how I am calling :
string = " "
for f in final:
string = string + " " + f + " \n"
# print("Results : \n" + string)
popupmsg("Results : \n" + string)