import tkinter as tk
def set_entry_value(entry, value):
entry.delete(0, tk.END) # Clear the existing value in the entry
entry.insert(0, value) # Set the new value
# Create a Tkinter window
window = tk.Tk()
# Create an Entry widget
entry = tk.Entry(window)
entry.pack()
# Button click callback function
def button_clicked():
# Call the set_entry_value function to set the entry's value to "Hello World"
set_entry_value(entry, "Hello World")
# Create a Button widget
button = tk.Button(window, text="Set Value", command=button_clicked)
button.pack()
# Start the Tkinter event loop
window.mainloop()