import tkinter as tk def show_entry_fields(): print("First Name: %s\n Last Name: %s" % (e1.get(),e2.get())) master = tk.Tk() tk.Label(master, text=" GUI", fg="red", font=('times', 24, 'italic')).grid(row=0) tk.Label(master, text="First Name").grid(row=1) tk.Label(master, text="Last Name").grid(row=2) e1 = tk.Entry(master) e2 = tk.Entry(master) e1.grid(row=1, column=1) e2.grid(row=2, column=1) tk.Label(master, text="Select Gender:", fg="blue").grid(row=3, column=0) R1=tk.Radiobutton(master, text="Male", value=1).grid(row=4, column=0, sticky=tk.W) R2=tk.Radiobutton(master, text="Female", value=2).grid(row=4, column=1, sticky=tk.W) tk.Label(master,text = "Select Age", fg="blue").grid(row=5, column=0) tk.Spinbox (master,from_= 18, to= 25).grid(row=5, column=1) tk.Label(master, text="Select Subject:", fg="blue").grid(row=6, column=0) tk.Checkbutton(master, text="Java").grid(row=7, column=0, sticky=tk.W) tk.Checkbutton(master, text="Python").grid(row=7, column=1, sticky=tk.W) tk.Checkbutton(master, text="PHP").grid(row=8, column=0, sticky=tk.W) tk. Checkbutton(master, text="C#.Net").grid(row=8, column=1, sticky=tk.W) tk.Label(master,text = "Select District", fg="blue").grid(row=9, column=0) listbox = tk. Listbox(master) listbox.insert(1, "Belgaum") listbox.insert(2, "Bangalore") listbox.insert(3, "Dharawad") listbox.insert(4, "Hubli") listbox.insert(5, "Mysore") listbox.insert(6, "Mangalore") listbox.grid(row=10,column=1) tk.Button(master, text="QUIT",fg="red",bg="yellow", command=master.quit).grid(row=11, column=0, sticky=tk.W, pady=4) tk.Button(master,text="SHOW",fg="red", bg="yellow",command=show_entry_fields).grid(row=11, column=1, sticky=tk. W,pady=4) tk.mainloop()