Adding labels & entry boxes to your GUI

PHOTO EMBED

Tue Aug 17 2021 15:17:38 GMT+0000 (Coordinated Universal Time)

Saved by @maryjaay666 #html

from tkinter import *

window = Tk()
window.title("Tkinter tutorial 2")
window.geometry("250x250")

# Adding a label to your window
name_label = Label(window, text="Name: ")
name_label.pack(anchor="w")

# Adding an entry to your window
name_entry = Entry(window)
name_entry.pack(anchor="w")

"""
anchor = Anchors are used to define where text is positioned relative to a reference point.

Here is list of possible constants, which can be used for Anchor attribute.

NW
N
NE
W
CENTER
E
SW
S
SE
"""

window.mainloop()
content_copyCOPY