Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Draw a 2d grid and allow coloring of cells

Tags:

python

I want to simulate the game of life problem using python. I want to draw a grid and be able to color its cells as the simulation progresses. How do I do that in Python?

like image 973
Bruce Avatar asked Feb 15 '10 08:02

Bruce


2 Answers

You can use pygame to do that.

To display the state of your simulation, you should create an 8 bit surface with a palette, and access it with the pygame.surfarray module.

like image 145
Luper Rouch Avatar answered Sep 23 '22 01:09

Luper Rouch


Take a look at PyGame too.

like image 36
Trevor Tippins Avatar answered Sep 25 '22 01:09

Trevor Tippins