4. Building a Simple User Information Form with Python Tkinter | GUI Application Tutorial

Publicado em: 24 Dezembro 2023
no canal de: KidzCode AI
207
1

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()


Nesta página do site você pode assistir ao vídeo on-line 4. Building a Simple User Information Form with Python Tkinter | GUI Application Tutorial duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário KidzCode AI 24 Dezembro 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 207 vezes e gostou 1 espectadores. Boa visualização!