I'm a beginner in Python and I'm trying to build some GUI to understand. I want to pass to a button a function that requies a parameter, but when I launch the script, it does not work. I'm attaching a python file.
from tkinter import *
from tkinter import messagebox
window = Tk()
window.title("Hello World")
window.geometry('350x200')
def clicked(msg):
messagebox.showinfo("Message",msg)
text = Entry(window,width=100)
text.grid(column = 1, row = 0)
btn = Button(window,text = "Click me",command = clicked(text.get()))
btn.grid(column=5, row=1)
window.mainloop()