how to align text in tkinter
Label(root, text='Pack', anchor='w').pack(fill='both')
# anchor='w' ---- w for left
# anchor='e' ---- e for right
# anchor='center' ---- center for center
how to align text in tkinter
Label(root, text='Pack', anchor='w').pack(fill='both')
# anchor='w' ---- w for left
# anchor='e' ---- e for right
# anchor='center' ---- center for center
add text to the middle of the window tkinter
import tkinter
window = tkinter.Tk() # creating the window object
window.title('my first GUI program')
window.minsize(width=600, height=500)
# label
# adding text to the middle of the window
my_label = tkinter.Label(text='I am a Label')
my_label.pack()
window.mainloop() # keeping the window until we close it
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us