python 用 tkinter 下拉框的时候,无法分行
file_path = "D:/TS/原始记录"
path_list = os.listdir(file_path)
print(path_list)
print(len(path_list))
data4=[]
for i in range(len(path_list)):
name5 = os.path.splitext(path_list[i])[0]
data3 = [name5]
data4.append(data3)
print(data4)
win = tk.Tk()
win.title('')
win.geometry("900x800")
value = StringVar()
value.set('2')
values = [data4]
combobox = ttk.Combobox(
master = win,
height = 10,
width = 20,
state = 'readonly',
cursor = 'arrow',
font = ('',15),
textvariable = '',
values= values,
)
combobox.pack()