from tkinter import * window = Tk() window.title("Tkinter Tutorial") window.geometry("150x250") # Creating function for button def save(): name = name_entry.get() contact = contact_entry.get() address = address_entry.get() window2 = Tk() l1 = Label(window2, text=("Name:" + name)) l1.pack() l2 = Label(window2, text=("Contact:" + contact)) l2.pack() l3 = Label(window2, text=("Address:" + address)) l3.pack() window2.mainloop() # Creating Entry Box # *********** name ************ name_label = Label(window, text="Name:") # Creating Label name_label.pack(anchor="w") name_entry = Entry(window) # Creating Entry name_entry.pack(anchor="w") # *********** contact ************ contact_label = Label(window, text="Contact:") # Creating Label contact_label.pack(anchor="w") contact_entry = Entry(window) # Creating Entry contact_entry.pack(anchor="w") # *********** address ************ address_label = Label(window, text="Address:") # Creating Label address_label.pack(anchor="w") address_entry = Entry(window) # Creating Entry address_entry.pack(anchor="w") # Adding a button to your tikinter window Button = Button(window, text="fetch this info") Button.pack() window.mainloop()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter