How to place widgets like labels & buttons with `.pack()`?
<p>Hello i am asking for help on a PyDev Eclipse problem i cold not find a solution on at this forum. My example below show that i have a window with a couple of labels and buttons etc. But the ting is that when i searched earlier i found posts on how to place widgets using <code>.grid()</code> and <code>.place()</code> but not any for <code>.pack()</code> which i am using. Therefor i want to know what would be the best way for me to place these widgets for example in the center of the parent window.</p>

<p>Thanks in advance. :D</p>

<pre><code>window.title("PTF Pydev Eclipse")
window.geometry("500x500")
window.config(bg="blue")

frame = tk.Frame(window, bg="blue")

lbl = tk.Label(frame, text= "secret")
lbl.config(background="blue", width="500")
ent = tk.Entry(frame)
lbl1 = tk.Label(frame, text= "secret", bg="blue")
ent1 = tk.Entry(frame)
lbl2 = tk.Label(frame, text= "secret", bg="blue")
btn = tk.Button(frame, text="secret", command= lambda: validation())

btn2 = tk.Button(frame, text="secret", command=lambda: page1())
lbl3 = tk.Label(frame, bg="blue", text="secret")
ent2 = tk.Entry(frame) #these 3 are packed in a function (not included).

lbl.pack()
ent.pack()
lbl1.pack()
ent1.pack()
lbl2.pack()
btn.pack()
frame.pack()

window.mainloop()
</code></pre>