from tkinter import *
import calendar
def mostrarcalendario():
root2 = Tk()
root2.config(background='white')
root2.title("Calendário")
root2.geometry("450x600")
root2.resizable(False,False)
ano_calendario = ano.get()
mostrar= calendar.calendar(ano_calendario)
calano = Label(root2,text= mostrar,font=("times", 10,))
calano.place(relx=0.05,rely=0.05)
root2.mainloop()
root = Tk()
def sair():
root.destroy()
root.title("Calendário")
root.geometry("400x300")
root.configure(background="white")
root.resizable(False,False)
texto1 = Label(root, text='Calendário de qualquer Ano',
font=("Ariel","15",'bold' ),fg="black",bg="white")
texto1.place(relx=0.18,rely=0.05)
texto2 = Label(root, text='Digite o Ano', font=("Ariel","12" ),
fg="green",bg="white")
texto2.place(relx=0.4,rely=0.2)
ano= IntVar()
entrada = Entry(root,textvariable=ano)
entrada.place(relx=0.35,rely=0.3)
butao1 = Button(root, text="Mostra o Calendário",command=mostrarcalendario)
butao1.place(relx=0.35,rely=0.55)
exist = Button(root, text="Sair",fg="black",bg="red",
font=("Ariel","15",'bold' ),command=sair)
exist.place(relx=0.45,rely=0.8)
root.mainloop()
Comentários
Enviar um comentário