Learn how to create a user-friendly GUI application in Python using Tkinter! In this tutorial, we'll build a simple User Information Form that collects a user's first name, last name, and email address. The script includes a responsive interface and a 'Save and Display' button that showcases the entered information. Follow along with the code, and enhance your Python GUI skills! #Python #Tkinter #GUIApplication #ProgrammingTutorial.
code goes here-
import tkinter as tk
root = tk.Tk()
all the widgets
title = tk.Label(root,text="Name and E-mail Reader\n")
first_name_label = tk.Label(root,text="Type your first name:")
first_name_entry = tk.Entry(root)
last_name_label = tk.Label(root,text="Type your last name:")
last_name_entry = tk.Entry(root)
email_label = tk.Label(root,text="Type your email:")
email_entry = tk.Entry(root)
save_button = tk.Button(root,text="Save & Display")
display_label = tk.Label(root,text="")
packing
title.pack()
first_name_label.pack()
first_name_entry.pack()
last_name_label.pack()
last_name_entry.pack()
email_label.pack()
email_entry.pack()
save_button.pack()
display_label.pack()
#function to read and save all the details from the entries
def read_data():
first_name = first_name_entry.get()
last_name = last_name_entry.get()
email = email_entry.get()
pass the details to the display label
display_label.config(text="Hello, "+first_name+" "+last_name+"!"+"\nEmail: "+email)
pass the function to the button
save_button.config(command=read_data)
root.mainloop()
Auf dieser Seite können Sie das Online-Video 4. Building a Simple User Information Form with Python Tkinter | GUI Application Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer KidzCode AI 24 Dezember 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 207 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!