xxxxxxxxxx
import tkinter as tk
from tkinter import OptionMenu
root = tk.Tk()
# Create a variable to store the selected option
selected_option = tk.StringVar()
# Define a list of options
options = ["Option 1", "Option 2", "Option 3"]
# Set an initial value for the option menu
selected_option.set(options[0])
# Create the OptionMenu widget
option_menu = OptionMenu(root, selected_option, *options)
option_menu.pack()
root.mainloop()