Here's my code snippet
footer_frame = tk.Frame()
tk.Label(footer_frame, text = 'by .....', font = 'arial 10', padx=5, pady=5).pack(side = tk.RIGHT, anchor='se')
footer_frame.pack(tk.BOTTOM)
Here's my code snippet
footer_frame = tk.Frame()
tk.Label(footer_frame, text = 'by .....', font = 'arial 10', padx=5, pady=5).pack(side = tk.RIGHT, anchor='se')
footer_frame.pack(tk.BOTTOM)
To put the label all the way to the right inside the footer, the simplest way is to use pack
and telling it to be on the right side.
Since you didn't have footer_frame
fill the bottom, it's going to be centered by default. And since a frame shrinks to fit its contents, the label will also appear centered.
Here's an example, which uses side='right'
for the label, and fill='x'
for the footer frame. I gave the label a distinctive color so that you can see where it is in relation to the window and frame.
import tkinter as tk
root = tk.Tk()
root.geometry("400x200")
footer_frame = tk.Frame(root)
label = tk.Label(footer_frame, text="by .....", background="bisque")
footer_frame.pack(side="bottom", fill="x")
label.pack(side="right")
root.mainloop()