import tkinter as tk def show_entry_fields(): print("first name:%s\nlast 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="slect district:",fg="blue").grid(row=9,column=0) Listbox=tk.Listbox(master) Listbox.insert(1,"bgm") Listbox.insert(2,"bgk") Listbox.insert(3,"hubli") Listbox.insert(4,"hkr") Listbox.insert(5,"ckd") Listbox.insert(6,"gkk") 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()