nba_teams = [
{
"nome": "Boston Celtics",
"divisao": "Atlantic",
"conferencia": "Este",
"titulos": [1957, 1959, 1960, 1961, 1962, 1963, 1964, 1965,
1966, 1968, 1969, 1974, 1976, 1981, 1984,
1986, 2008, 2024],
"fundacao": 1946
},
{
"nome": "Brooklyn Nets",
"divisao": "Atlantic",
"conferencia": "Este",
"titulos": [],
"fundacao": 1967
},
{
"nome": "New York Knicks",
"divisao": "Atlantic",
"conferencia": "Este",
"titulos": [1970, 1973],
"fundacao": 1946
},
{
"nome": "Philadelphia 76ers",
"divisao": "Atlantic",
"conferencia": "Este",
"titulos": [1955, 1967, 1983],
"fundacao": 1946
},
{
"nome": "Toronto Raptors",
"divisao": "Atlantic",
"conferencia": "Este",
"titulos": [2019],
"fundacao": 1995
},
{
"nome": "Chicago Bulls",
"divisao": "Central",
"conferencia": "Este",
"titulos": [1991, 1992, 1993, 1996, 1997, 1998],
"fundacao": 1966
},
{
"nome": "Cleveland Cavaliers",
"divisao": "Central",
"conferencia": "Este",
"titulos": [2016],
"fundacao": 1970
},
{
"nome": "Detroit Pistons",
"divisao": "Central",
"conferencia": "Este",
"titulos": [1989, 1990, 2004],
"fundacao": 1941
},
{
"nome": "Indiana Pacers",
"divisao": "Central",
"conferencia": "Este",
"titulos": [], # Tem 3 títulos da ABA, não da NBA
"fundacao": 1967
},
{
"nome": "Milwaukee Bucks",
"divisao": "Central",
"conferencia": "Este",
"titulos": [1971, 2021],
"fundacao": 1968
},
{
"nome": "Atlanta Hawks",
"divisao": "Southeast",
"conferencia": "Este",
"titulos": [1958],
"fundacao": 1946
},
{
"nome": "Charlotte Hornets",
"divisao": "Southeast",
"conferencia": "Este",
"titulos": [],
"fundacao": 1988
},
{
"nome": "Miami Heat",
"divisao": "Southeast",
"conferencia": "Este",
"titulos": [2006, 2012, 2013],
"fundacao": 1988
},
{
"nome": "Orlando Magic",
"divisao": "Southeast",
"conferencia": "Este",
"titulos": [],
"fundacao": 1989
},
{
"nome": "Washington Wizards",
"divisao": "Southeast",
"conferencia": "Este",
"titulos": [1978],
"fundacao": 1961
},
{
"nome": "Denver Nuggets",
"divisao": "Northwest",
"conferencia": "Oeste",
"titulos": [2023],
"fundacao": 1967
},
{
"nome": "Minnesota Timberwolves",
"divisao": "Northwest",
"conferencia": "Oeste",
"titulos": [],
"fundacao": 1989
},
{
"nome": "Oklahoma City Thunder",
"divisao": "Northwest",
"conferencia": "Oeste",
"titulos": [1979],
"fundacao": 1967
},
{
"nome": "Portland Trail Blazers",
"divisao": "Northwest",
"conferencia": "Oeste",
"titulos": [1977],
"fundacao": 1970
},
{
"nome": "Utah Jazz",
"divisao": "Northwest",
"conferencia": "Oeste",
"titulos": [],
"fundacao": 1974
},
{
"nome": "Golden State Warriors",
"divisao": "Pacific",
"conferencia": "Oeste",
"titulos": [1947, 1956, 1975, 2015, 2017, 2018, 2022],
"fundacao": 1946
},
{
"nome": "LA Clippers",
"divisao": "Pacific",
"conferencia": "Oeste",
"titulos": [],
"fundacao": 1970
},
{
"nome": "Los Angeles Lakers",
"divisao": "Pacific",
"conferencia": "Oeste",
"titulos": [1949, 1950, 1952, 1953, 1954, 1972, 1980,
1982, 1985, 1987, 1988, 2000, 2001,
2002, 2009, 2010, 2020],
"fundacao": 1947
},
{
"nome": "Phoenix Suns",
"divisao": "Pacific",
"conferencia": "Oeste",
"titulos": [],
"fundacao": 1968
},
{
"nome": "Sacramento Kings",
"divisao": "Pacific",
"conferencia": "Oeste",
"titulos": [1951],
"fundacao": 1923
},
{
"nome": "Dallas Mavericks",
"divisao": "Southwest",
"conferencia": "Oeste",
"titulos": [2011],
"fundacao": 1980
},
{
"nome": "Houston Rockets",
"divisao": "Southwest",
"conferencia": "Oeste",
"titulos": [1994, 1995],
"fundacao": 1967
},
{
"nome": "Memphis Grizzlies",
"divisao": "Southwest",
"conferencia": "Oeste",
"titulos": [],
"fundacao": 1995
},
{
"nome": "New Orleans Pelicans",
"divisao": "Southwest",
"conferencia": "Oeste",
"titulos": [],
"fundacao": 2002
},
{
"nome": "San Antonio Spurs",
"divisao": "Southwest",
"conferencia": "Oeste",
"titulos": [1999, 2003, 2005, 2007, 2014],
"fundacao": 1967
}
]
from tkinter import *
root = Tk()
root.geometry("700x400")
root.resizable(0, 0)
root.config(bg="#103030")
root.title("NBA")
titulo = Label(root, text="NBA", font=("Arial", 40, "bold"), bg="#103030", fg="#49e3e3")
titulo.place(relx=0.35, rely=0.05)
selected_team = StringVar()
selected_team.set("Selecione uma equipa")
def show_info(*args):
nome = selected_team.get()
for team in nba_teams:
if team["nome"] == nome:
titulos = team["titulos"]
if titulos:
# Divide a lista de títulos em grupos de 6 para melhor visualização
linhas = [", ".join(map(str, titulos[i:i + 6])) for i in range(0, len(titulos), 6)]
titulos_formatados = "\n ".join(linhas) # quebra com indentação
titulos_str = f"{len(titulos)} ({titulos_formatados})"
else:
titulos_str = "0 (Nenhum)"
info = f"Divisão: {team['divisao']}\n"
info += f"Conferência: {team['conferencia']}\n"
info += f"Fundação: {team['fundacao']}\n"
info += f"Títulos: {titulos_str}"
label_info.config(text=info)
break
else:
label_info.config(text="")
team_names_sorted = sorted([team["nome"] for team in nba_teams])
option_menu = OptionMenu(root, selected_team, *team_names_sorted, command=lambda _: show_info())
option_menu.config(bg="#09A3BA", fg="#FFFFFF", font=("Arial", 25, "bold"), highlightthickness=0)
option_menu["menu"].config(bg="#09A3BA", fg="#FFFFFF", font=("Arial", 25, "bold"))
option_menu.place(relx=0.15, rely=0.25,relwidth=0.7)
label_info = Label(root, text="", font=("Arial", 14), bg="#103030", fg="#FFFFFF", justify=LEFT)
label_info.place(relx=0.35, rely=0.45)
root.mainloop()