First, I read the related discussion: How can I put 2 buttons next to each other?.
However, I still confused about it. My codes:
#Import the required Libraries
from tkinter import *
from tkinter import ttk
import random
win = Tk()
win.geometry("750x250")
def clear():
entry.delete(0,END)
def display_num():
for i in range(1):
entry.insert(0, random.randint(5,20))
entry= Entry(win, width= 40)
entry.pack()
button1= ttk.Button(win, text= "Print", command=display_num)
button1.pack(side= LEFT)
button2= ttk.Button(win, text= "Clear", command= clear)
button2.pack(side=LEFT)
win.mainloop()
Now I got
I want two buttons in the middle of screen just below the Entry (white box).
How to fix it? Thanks!