import tkinter as tki class MyApp: def __init__(self,root): top_frame = tki.Frame(root) bottom_frame = tki.Frame(root) top_frame.pack() bottom_frame.pack() for i in range(4): b = tki.Button(top_frame,text=str(i)) b.pack(side = tki.LEFT) b = tki.Button(bottom_frame,text=str(i)) b.pack(side = tki.LEFT) root = tki.Tk() MyApp(root) root.mainloop()