May-28-2024, 06:17 PM
(This post was last modified: May-28-2024, 08:11 PM by Gribouillis.)
Hola soy muy nueva en Python, estoy intentando crear un calendario con este código.
"NameError: name 'Calendar' is not defined" no sé cómo resolverlo.
¿Alguien podría ayudarme?
Gracias!
from tkinter import * from tkcalendar import * root = Tk() root. Title("Calendario") root. Geometry("500x350") root.config(bg="gray") cal = Calendar(root, select="day", year=2024, month=5, day=28) cal.pack(pady=20, fill='both', expand='yes') def Fecha(): Label_text.config(text="Fecha de hoy " + cal.get_date()) Button = Button(root, text="fecha", command=Fecha) Button.pack(pady=20) Label_text = Label(root, text="") Label_text.pack(pady=20) root.mainloop()He configurado el Path e instalado tkcalendar, al ejecutar el código me sale este error:
"NameError: name 'Calendar' is not defined" no sé cómo resolverlo.
¿Alguien podría ayudarme?
Gracias!
Gribouillis write May-28-2024, 08:11 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.