Python calendar on userform

I am using below code , userform created via python.

Hi Team,

Can we add colorful calender on GUI Userform

import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from tkcalendar import DateEntry

def submit():
    entry1_value = entry1.get()
    entry2_value = entry2.get()
    selected_country = country_combobox.get()
    selected_item = my_listbox.get(my_listbox.curselection())
    selected_date = dob_entry.get()
    print("Entry 1:", entry1_value)
    print("Entry 2:", entry2_value)
    print("Selected Country:", selected_country)
    print("Selected Item:", selected_item)
    print("Selected Date:", selected_date)

    messagebox.showinfo("Request Received", "Request received")

root = tk.Tk()
root.title("My UserForm")

label1 = tk.Label(root, text="Label 1")
label1.grid(row=0, column=0, padx=10, pady=10)

label2 = tk.Label(root, text="Label 2")
label2.grid(row=1, column=0, padx=10, pady=10)

entry1 = tk.Entry(root, width=30)
entry1.grid(row=0, column=1, padx=10, pady=10)

entry2 = tk.Entry(root, width=30)
entry2.grid(row=1, column=1, padx=10, pady=10)

country_label = tk.Label(root, text="Country")
country_label.grid(row=2, column=0, padx=10, pady=10)

country_combobox = ttk.Combobox(root, values=("India", "US", "China", "Australia"))
country_combobox.grid(row=2, column=1, padx=10, pady=10)

my_listbox = tk.Listbox(root)
my_listbox.grid(row=3, column=1, padx=10, pady=10)

my_listbox.insert(tk.END, 1)
my_listbox.insert(tk.END, 2)
my_listbox.insert(tk.END, 3)
my_listbox.insert(tk.END, 4)

# Create the Date_of_birth label
dob_label = tk.Label(root, text="Date of Birth")
dob_label.grid(row=4, column=0, padx=10, pady=10)

# Create the DateEntry widget (date picker)
dob_entry = DateEntry(root)
dob_entry.grid(row=4, column=1, padx=10, pady=10)

submit_button = tk.Button(root, text="Submit", command=submit)
submit_button.grid(row=5, column=0, columnspan=2, pady=10)


What have you tried?

For example, have you tried using Widget styling?

I’ve not used the tkcalendar package and as such, I don’t know what challenges you’re facing.