Take the 2-minute tour ×

I'm writing a pathfinding visualizer in python and Pygame. I intend to write a visualizer that can simultaneously simulate multiple pathfinding algorithms. I have two possible approaches

  1. I write a server part of the application, that will calculate path and will send it to client part, that will use pygame to draw grid and render simulation.

  2. I write a master thread, that will do pathfinding and will send information to grid thread using pipes.

Which approach should I use?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You're overthinking this. Either method is fine, but you probably don't want to use threads for CPU-bound operations. Use the multiprocessing module instead if you're shooting for concurrency.

But really, the pygame code should be negligible in terms of processing. Focus on making your pathfinding efficient (perhaps implemented in C?) instead.

share|improve this answer
add comment

Your Answer


