Skip to content

Commit 0db3f43

Browse files
feat: Python Tkinter How To Position Label Text Complete
Python Tkinter How to position Label Text Complete resolve: see also:
1 parent c465288 commit 0db3f43

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

Python Tkinter How To Position Label Text/howToPositionLabelTex.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,30 @@
33

44
from tkinter import *
55

6-
76
root = Tk()
87
root.title('Python Tkinter How To Position Label Text')
98
root.iconbitmap('Python Tkinter How To Position Label Text/icons/label.ico')
10-
root.geometry("600x600")
11-
9+
root.geometry("500x500")
10+
11+
my_label1 = Label(root,
12+
text="Brian\nBrian Brian\nBrian Brian Brian",
13+
font=("Comic Sans", 18),
14+
bd=1, relief="sunken")
15+
my_label1.pack(pady=20, ipady=10, ipadx=10)
16+
17+
my_label2 = Label(root,
18+
text="Brian\nBrian Brian\nBrian Brian Brian",
19+
font=("Comic Sans", 18),
20+
bd=1, relief="sunken",
21+
justify="left")
22+
my_label2.pack(pady=20, ipady=10, ipadx=10)
23+
24+
my_label3 = Label(root,
25+
text="Brian\nBrian Brian\nBrian Brian Brian",
26+
font=("Comic Sans", 18),
27+
bd=1, relief="sunken",
28+
justify="right")
29+
my_label3.pack(pady=20, ipady=10, ipadx=10)
1230

1331

1432
root.mainloop()

0 commit comments

Comments
 (0)