cmb1 = ttk.Combobox(tk,width=5,values = [str(year) for year in range(datetime.now().year, datetime.now().year-5,-1)]).place(x=110,y=135)
cmb1=cmb1.current(2)
报错:AttributeError: 'NoneType' object has no attribute 'current'
...全文
7835打赏收藏
Combobox写下拉列表时无法使用current设置默认值
cmb1 = ttk.Combobox(tk,width=5,values = [str(year) for year in range(datetime.now().year, datetime.now().year-5,-1)]).place(x=110,y=135) cmb1=cmb1.current(2) 报错:AttributeError: 'NoneType' object has no attribute 'current'
cmb1 = ttk.Combobox(tk,width=5,values = [str(year) for year in range(datetime.now().year, datetime.now().year-5,-1)])
cmb1.place(x=110,y=135)
cmb1=cmb1.current(2)