File one.py
from tkinter import *
import two
root = Tk()
button = Button(text='Click me', command=two.action)
button.pack()
root.mainloop()
File two.py
from tkinter import *
def action():
two = Tk()
list = [1, 2, 3]
clicked = StringVar()
clicked.set("Please choose PLC")
Label(two, text="Choose PLC ", width=15, anchor='w').grid(row=0, column=0)
drop = OptionMenu(two, clicked, *list)
drop.config(fg='#777', width=15, height=1)
drop.grid(row=0, column=1)
two.mainloop()
if __name__ == '__main__':
action()
f I run two.py by itself I can see a default value at OptionMenu and the one I chose as well. If I ran two.py from one.py the OptionMenu box is empty. Any ideas where is an error?