I am writing a code to generate tournament brackets for the user. I wrote this piece of code so the user can input the number of teams participating in the tournament. I want to limit the input to only an integer, and the number should be less than or equal to 16 and more than 1. How do I add onto my code to accomplish this?
#Designing window for selecting number of teams for round-robin tournament(max 16)
from tkinter import *
def enter_numberofitems2():
enter_numberofitems2_screen = Tk()
enter_numberofitems2_screen.geometry("1000x500")
enter_numberofitems2_screen.title("Enter Number of Players/Teams")
Var1 = IntVar()
Label(enter_numberofitems2_screen, text= "Choose Number of Players/Teams", bg="yellow",
width="300", height="5", font=("Calibri", 20)).pack()
Label(enter_numberofitems2_screen, text="").pack()
Label(enter_numberofitems2_screen, text="Enter here", fg="green", height = "1", width =
"15", font=("calibri", 15)).pack()
enter_teams = Entry(enter_numberofitems2_screen,textvariable=Var1).pack()
Label(enter_numberofitems2_screen, text="").pack()
Button(enter_numberofitems2_screen, text="Submit", height="5", width = "30",
bg="green").pack()
enter_numberofitems2_screen.mainloop()