import tkinter as tk def on_button_click(entry_text): print(f"The argument passed is: {entry_text}") root = tk.Tk() entry = tk.Entry(root) entry.pack() button = tk.Button(root, text="Submit", command=lambda: on_button_click(entry.get())) button.pack() root.mainloop()