File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Python Tkinter How To Position Label Text Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 3
3
4
4
from tkinter import *
5
5
6
-
7
6
root = Tk ()
8
7
root .title ('Python Tkinter How To Position Label Text' )
9
8
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\n Brian Brian\n Brian 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\n Brian Brian\n Brian 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\n Brian Brian\n Brian 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 )
12
30
13
31
14
32
root .mainloop ()
You can’t perform that action at this time.
0 commit comments