Making an array of spiral numbers
You're using non-standard names. Usual names are A for the matrix, i for the row index, and j for the column index.
List repetition and comprehension make the initialization shorter and faster.
Using deltas for the four directions can avoid quadrupling code.
You can know when to change direction by checking whether the next element in the current direction is already set.
Your check is inefficient. Instead of searching the matrix for an unset spot, just do while count &lt;= n**2:. Or, try to loop through the range of numbers.
Your current code crashes for n = 0 because it always enters the loop, as you compute run only at the end. With while count &lt;= n**2: you'd succeed.

def spiralNumbers(n):
    A = [[0] * n for _ in range(n)]
    i = j = di = 0
    dj = 1
    for A[i][j] in range(1, n**2 + 1):
        if A[(i+di) % n][(j+dj) % n]:
            di, dj = dj, -di
        i += di
        j += dj
    return A

The % n is just a little trick to avoid checking for index-out-of-bounds.