任何人都可以提供一些指导。我有一个日历小部件,只要选择一天,它就会返回错误。错误以多种格式出现,并且总是在日期前显示 (-) 负号,
from tkinter import *
from tkcalendar import *
root =Tk()
root.title("Calendar Selector")
root.geometry("400x400")
root.iconbitmap(r'C:\Users\Paul Hannell\python_files\Timelord.ico')
###################
# This puts a calendar on the screen
race_day = Calendar(root, selectmode="day", date_pattern="dd/mm/yyyy")
race_day.grid(row=0, column=0)
def select_date():
date_label.config(race_day.get_date())
calendar_button =Button(root, text="New Race Date", command=select_date)
calendar_button.grid(row=1, column=0, pady=20)
date_label = Label(root, text="")
date_label.grid(row=2, column=0)
root.mainloop()