Conway's Game of Life python
First three general remarks:


range does not need an explicit start argument, it defaults to 0. range is basically range(start=0, stop, step=1), only stop is needed
if takes an expression as argument which just has to evaluate truthy or falsey. There is no need for parenthesis, unless chaining multiple expressions over multiple lines or doing some complicated and/or logic.
you should consistently use 4 spaces per indentation level (your class only has 2 in the outer level).




Your setting up of the board can be simplified with a list comprehension:

self.board = [[random.random() for _ in range(w)] for _ in range(h)]


Here I used _ as an unused loop variable, as customary in Python.

I would also save h and w in the class for later use.



In Game.next_gen:

if (n == 1 or n == 0):
    c = 0
elif (n == 3):
    c = 1
elif (n == 2):
    pass
else:
    c = 0


is equivalent to:

if n == 3:
    c = 1
elif n != 2:
    c = 0


I would make two helper functions calculating neighbours that are alive:

def neighbours(self, x, y):
    p = -1, 0, 1
    for dx, dy in itertools.product(p, p)
        if dx == dy == 0:
            continue
        _x, _y = x + dx, y + dy
        if 0 &lt;= _x &lt; self.h and 0 &lt;= _y &lt; self.w:
            yield _x, _y

def alive_neighbours(self, x, y):
    return sum(self.board[n_x][n_y] &gt; 0 for n_x, n_y in self.neighbours(x, y))


Here I used the boundaries to make sure that neighbours only serves points inside the grid (and used itertools.product to make it easier to construct dx and dy). Then getting the sum of all alive neighbours just sums over the values, since in self.board empty cells have a value of zero, while alive cells a value greater than zero.

This simplifies next_gen to:

def next_gen(self):
   board_next = [[0 for _ in range(self.w)] * self.h]
   for x in range(len(self.board)):
       for y in range(len(self.board[x])):
           n = self.alive_neighbours(x, y)
           cell = self.board[x][y]
           if n == 3:
              cell = 1
           elif n != 2:
              cell = 0
           board_next[x][y] = cell
   self.board = board_next[:]




Your show function can be simplified using str.join:

def show(self):
   for row in self.board:
       print("".join("X" if cell else "#" for cell in row))


The time.sleep(0.5) I would put in start to make it possible to show the generation without delay if necessary.



I would put the code calling your class into a if __name__ == "__main__": guard to allow importing your class from another module:

if __name__ == "__main__":
    os.system('clear')
    game = Game(3, 3, 3)
    game.board = [
      [0, 0, 0],
      [1, 1, 1],
      [0, 0, 0]]
    game.start()