1

I want it to look like this:

enter image description here

so I did this:

seats = ['F11', 'F12', 'F13', 'F14', 'F21', 'F22', 'F23', 'F24', 'B31', 'B32', 'B33', 'B34',
     'B41', 'B42', 'B43', 'B44', 'B51', 'B52', 'B53', 'B54', 'E61', 'E62', 'E63', 'E64', 
     'E71', 'E72', 'E73', 'E74', 'E81', 'E82', 'E83', 'E84', 'E91', 'E92', 'E93', 'E94']

for i in seats:
if i[2] == "3" or i[2] == "4":
    Label(root, text="").grid(row=int(i[1]),column=3, columnspan=12)
    Button(root, text=i).grid(row=int(i[1]), column=int(i[2])+10)
else:
    Button(root, text=i).grid(row=int(i[1]), column=int(i[2]))

which gives me this:

enter image description here

Im missing the horizontal blanks, is there a way to incoperate it?

Thingamabobs
  • 7,274
  • 5
  • 21
  • 54
abi
  • 50
  • 4

1 Answers1

1

I would create six frames, one for each group of buttons. You can then use grid to position those six frames with as much padding between each group as you like. Then, within each frame you can place the buttons however you want.

Another option is to simply add a blank row between each group. You can leave the row empty but give it a minimum size with rowconfigure, or you can place a frame in it that is the same height as the amount of empty space that you want.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • I tired to add the buttons within the frames itself but instead it places the buttons in the mainframe even after specifying where its placed. – abi Aug 22 '21 at 09:14
  • the parent frame isnt considered and instead the grid is – abi Aug 22 '21 at 09:26