You could try looking at pygame. It is a really handy module that comes in use all the time.
Here is a sample code that works:
import pygame
a=[[22,10,21,22,15,16],
[24,21,13,20,14,17],
[23,17,38,23,17,16],
[25,25,22,14,15,21],
[27,22,12,11,21,20],
[24,21,10,12,22,23]]
BLOCKSIZE = 16
WIDTH = len(a[0]) * BLOCKSIZE
HEIGHT = len(a) * BLOCKSIZE
DISPLAY = (WIDTH, HEIGHT)
WHITE = (255.0,255.0,255.0)
pygame.init()
screen = pygame.display.set_mode(DISPLAY,0,32)
x = y = 0
for row in a:
for item in row:
screen.fill((WHITE[0]*item/50,WHITE[1]*item/50,WHITE[2]*item/50),(x,y,BLOCKSIZE,BLOCKSIZE))
y += BLOCKSIZE
x += BLOCKSIZE
y = 0
pygame.display.update()
while 1:
pass
What this code does is it looks at the value then converts it to a grey color corresponding to its value (0 is black and 50 is white). It then draws it on the screen.
AGAIN, read up on pygame. It is REALLY useful