Is there any standard way tkinter apps allow the user to choose a date?
The answers here provide most of what you asked for, but I felt none of them were completely satisfying. As a Tkinter newbie, I needed more hand-holding. My complaints:
So with gratitude to the previous answers which helped me immensely, here's my version.
def get_date():
import tkinter as tk
from tkinter import ttk
from tkcalendar import Calendar, DateEntry
def cal_done():
top.withdraw()
root.quit()
root = tk.Tk()
root.withdraw() # keep the root window from appearing
top = tk.Toplevel(root)
cal = Calendar(top,
font="Arial 14", selectmode='day',
cursor="hand1")
cal.pack(fill="both", expand=True)
ttk.Button(top, text="ok", command=cal_done).pack()
selected_date = None
root.mainloop()
return cal.selection_get()
selection = get_date()
print(selection)