import pygame, time, random pygame.init() screen = pygame.display.set_mode([601,601]) screen.fill([0,0,0]) pygame.display.flip() for j in range(0,1000): color1 = random.randint(0,255) color2 = random.randint(0,255) color3 = random.randint(0,255) left = random.randint(0,500) top = random.randint(0,500) width = random.randint(10,80) height = random.randint(10,80) pygame.draw.rect(screen, [color1,color2,color3], [left,top,width,height], 0) time.sleep(.01) pygame.display.flip() raw_input("Press ENTER to close the graphics window") pygame.quit()