I am a newbie in PyQt5. I'm trying to create a cell grid with a button at the bottom:
g = QGridLayout(window)
for i in range(N):
for j in range(N):
b = QPushButton()
g.addWidget(b, i, j, 1, 1)
g.addWidget(QPushButton("Last move"), N+4, N//2)
And this is what I get:

As you see, the button spoils everything. How to can I get rid of the space between the cells?
You need to merge the cells together in the bottom row, so the button doesn't get a column of its own:
The third and fourth arguments set the row and column span of the cell. If you want the button to stretch the full width, omit the last argument.