I don't have a lot of time, but here is a simple example to start you, using Tkinter. The other GUI toolkits, WxPython and QT, would be similar.
from Tkinter import *
root = Tk()
canvas = Canvas(root, width =300, height=300)
## top_left_x, top_left_y, bottom_right_x, bottom_right_y
points_list = [0, 0, 25, 25]
color = "red"
for row in range(3):
for col in range(3):
rectang = canvas.create_rectangle(points_list, points_list, \
points_list, points_list, fill=color)
## increase along the x axis
for point in [0, 2]:
points_list[point] += 50
## move down one row
if row%2: ## row is an odd number
points_list = [ 0, points_list+25, 25, points_list+25]
else: ## row is an even number
points_list = [25, points_list+25, 50, points_list+25]
The middle rectangle, be it red or white is centered, so if you have a 200x200 canvas, the middle would be 100. You can then move left or right, calculating the end position of the first red square for the rows with 4 red squares; end position=middle - (1.5 white + 1 red). The other row is obviously rectangles of the same size.