Adding Multiple Folder Names From Directory To OptionMenu Python
You need to build a list of menu options and then unpack it where you're passing new
at the moment:
options = []for dirs in all_subdirs: ... # same options.append(str(current).split("\\")[3])
Unpacking options
:
opt1 = OptionMenu(app, var, *options)
Note: options
will be the same as all_subdirs
, so your processing doesn't seem to achieve anything. Just use all_subdirs
instead.