0

I am trying to create an OptionMenu, and it works. But, when I click an option, it doesn't show it in the actual dropdown menu. Here is the code (SNIPPET! If you need the full code, ask me):

import os
options2 = []
for i in os.listdir():
        try:
            os.chdir(i)
            for i in os.listdir():
                if ".exe" in i:
                    options2.append(i)
        except Exception as e:
            print("an error has occured: " + str(e))
optionmenuv = StringVar()
optionmenuv.set("Select an option")
optionmenu = OptionMenu(w2, optionmenuv, *options2)
optionmenu.place(x=10, y=10)

This code tries to create a dropdown menu that lists all the apps in a subdirectory of a directory. Again, this isn't the full code, ask me if you need it. I have more than 1 optionmenu in the actual code, and it works fine. The only difference is that the list is created with a loop, which shouldn't be a problem.

Thanks in advance!

0 Answers0