-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Expand file tree
/
Copy pathaddress_form.py
More file actions
39 lines (31 loc) · 846 Bytes
/
address_form.py
File metadata and controls
39 lines (31 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import tkinter as tk
root = tk.Tk()
root.title("Address Entry Form")
frm_form = tk.Frame(relief=tk.SUNKEN, borderwidth=3)
frm_form.pack()
field_labels = [
"First Name:",
"Last Name:",
"Address Line 1:",
"Address Line 2:",
"City:",
"State/Province:",
"Postal Code:",
"Country:",
]
for index, text in enumerate(field_labels):
tk.Label(
master=frm_form,
text=text,
).grid(row=index, column=0, sticky="e")
tk.Entry(
master=frm_form,
width=50,
).grid(row=index, column=1)
frm_buttons = tk.Frame()
frm_buttons.pack(fill=tk.X, ipadx=5, ipady=5)
btn_submit = tk.Button(master=frm_buttons, text="Submit")
btn_submit.pack(side=tk.RIGHT, padx=10, ipadx=10)
btn_clear = tk.Button(master=frm_buttons, text="Clear")
btn_clear.pack(side=tk.RIGHT, ipadx=10)
root.mainloop()