- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabelOnWindow.py
More file actions
Latest commit
12 lines (10 loc) · 627 Bytes
/
Copy pathLabelOnWindow.py
File metadata and controls
12 lines (10 loc) · 627 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
# we still need to import tkinter
importtkinterastk
# we import a new module that provides advanced widgets to make the GUI look great.
fromtkinterimportttk
win=tk.Tk()
win.title('Adding a Label')
# Adds a label to the window. We pass the Tk instance, and the text that will be display as a label. We also make use of the grid layout manager method to position the label on the window. This also allows for the GUI to epxand automatically when te text becomes longer.
#
ttk.Label(win, text='Pythong Programming is AWESOME! Making the text longer expands the GUI automatically.').grid(column=0, row=0)
win.mainloop()