Bruce
Bruce

Reputation: 35275

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

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?

Upvotes: 5

Views: 2594

Answers (5)

Josh
Josh

Reputation: 1356

I know this is an old post, but in the name of building the perfect QA site, I would suggest matplotlib.

As of this writing, it looks like matplotlib development is getting more attention than pygame development.

Upvotes: 1

Stefan Monov
Stefan Monov

Reputation: 11732

I suggest Gloss, it's like PyGame except hardware accelerated. It also provides many other game-programming goodies.

Upvotes: 2

Luper Rouch
Luper Rouch

Reputation: 9492

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.

Upvotes: 8

Trevor Tippins
Trevor Tippins

Reputation: 2847

Take a look at PyGame too.

Upvotes: 4

Kimvais
Kimvais

Reputation: 39548

I suggest taking a look at the Python Imaging Library (PIL) documentation

Upvotes: 1

Related Questions