import tkinter as tk
root = tk.Tk()
root.title("逻辑峰")
root.geometry('300x200+300+300')
root.iconbitmap('../image/icon.ico')
# 如果是数字使用 from_和to参数,范围 0-20,并且与2步长递增或递减
w = tk.Spinbox(root, from_=0, to=20, increment=2, width=15, bg='#9BCD9B')
w.pack()
# 显示窗口
root.mainloop()