Mundo em Python

Debates das Legislativas 2025

from datetime import datetime
from tkinter import * debates = {
"2025-04-07": [
("21h00", "Luís Montenegro (AD) x Paulo Raimundo (CDU) - TVI"),
("22h00", "André Ventura (Chega) x Inês Sousa Real (PAN) - RTP3")
],
"2025-04-08": [
("21h00", "Pedro Nuno Santos (PS) x Mariana Mortágua (BE) - SIC"),
("22h00", "André Ventura (Chega) x Rui Tavares (Livre) - RTP3")
],
"2025-04-09": [
("18h00", "Paulo Raimundo (CDU) x Rui Tavares (Livre) - SIC Notícias")
],
"2025-04-10": [
("21h00", "Pedro Nuno Santos (PS) x Rui Rocha (IL) - RTP1"),
("22h00", "Mariana Mortágua (BE) x Inês Sousa Real (PAN) - CNN Portugal")
],
"2025-04-11": [
("21h00", "Nuno Melo (AD) x Rui Tavares (Livre) - TVI"),
("22h00", "Rui Rocha (IL) x Paulo Raimundo (CDU) - SIC Notícias")
],
"2025-04-12": [
("21h00", "Pedro Nuno Santos (PS) x Inês Sousa Real (PAN) - TVI"),
("22h00", "Mariana Mortágua (BE) x Paulo Raimundo (CDU) - RTP3")
],
"2025-04-13": [
("21h00", "Nuno Melo (AD) x Inês Sousa Real (PAN) - SIC"),
("22h00", "Rui Rocha (IL) x Rui Tavares (Livre) - CNN Portugal")
],
"2025-04-14": [
("21h00", "Luís Montenegro (AD) x Rui Rocha (IL) - RTP1"),
("22h00", "Mariana Mortágua (BE) x Rui Tavares (Livre) - SIC Notícias")
],
"2025-04-15": [
("21h00", "Pedro Nuno Santos (PS) x André Ventura (Chega) - TVI"),
("22h00", "Rui Rocha (IL) x Inês Sousa Real (PAN) - SIC Notícias")
],
"2025-04-16": [
("21h00", "Nuno Melo (AD) x Mariana Mortágua (BE) - RTP1"),
("22h00", "André Ventura (Chega) x Paulo Raimundo (CDU) - CNN Portugal")
],
"2025-04-17": [
("21h00", "Pedro Nuno Santos (PS) x Rui Tavares (Livre) - SIC"),
("22h00", "André Ventura (Chega) x Rui Rocha (IL) - RTP3")
],
"2025-04-21": [
("21h00", "Pedro Nuno Santos (PS) x Paulo Raimundo (CDU) - RTP1"),
("22h00", "André Ventura (Chega) x Mariana Mortágua (BE) - SIC Notícias")
],
"2025-04-22": [
("18h00", "Rui Tavares (Livre) x Inês Sousa Real (PAN) - RTP3")
],
"2025-04-23": [
("18h00", "Paulo Raimundo (CDU) x Inês Sousa Real (PAN) - CNN Portugal")
],
"2025-04-24": [
("21h00", "Luís Montenegro (AD) x André Ventura (Chega) - SIC"),
("22h00", "Rui Rocha (IL) x Mariana Mortágua (BE) - CNN Portugal")
],
"2025-04-28": [
("21h00", "Luís Montenegro (AD) x Pedro Nuno Santos (PS) - simultâneo SIC/RTP/TVI")
],
"2025-05-05": [
("09h30",
"Debate das rádios entre líderes dos partidos com assento parlamentar -\n"
" simultâneo Antena 1/Observador/Renascença/TSF")
]
} # Nova versão da função que retorna uma string
def obter_debates(data):
data_str = data.strftime("%Y-%m-%d")
if data_str in debates:
resultado = f"Debates para {data_str}:\n\n"
for hora, debate in debates[data_str]:
resultado += f"{hora}: {debate}\n"
return resultado
else:
return f"Não há debates para {data_str}."

# Interface com Tkinter
root = Tk()
root.geometry("700x200")
root.resizable(0, 0)
root.config(bg="#103030")
root.title("Debates das Legislativas 2025") titulo = Label(root, text="Debates das Legislativas 2025",
font=("Arial", 28, "bold"), bg="#103030", fg="#49e3e3")
titulo.place(relx=0.05, rely=0.05) # Obter data atual e os debates
data_atual = datetime.today()
texto_debates = obter_debates(data_atual) # Mostrar os debates
texto_label = Label(root, text=texto_debates,
font=("Arial", 14), bg="#103030", fg="#ffffff", justify=LEFT)
texto_label.place(relx=0.05, rely=0.38) root.mainloop()
0