Dan Anglin
a919c2698b
When the Maze Solver was idle the wait_for_close() loop ran which continuously redrew the window in an infinite while loop. This caused the CPU usage to spike between 70%-80%. This commit removes that method and uses the _root.mainloop() instead to keep the window visible on the screen. With this the CPU usage has dropped to > 1% when idle.
22 lines
350 B
Python
22 lines
350 B
Python
from graphics import Window
|
|
from maze import Maze
|
|
|
|
|
|
def main():
|
|
window = Window(800, 800)
|
|
|
|
_ = Maze(
|
|
x_position=10,
|
|
y_position=10,
|
|
num_cell_rows=30,
|
|
num_cells_per_row=30,
|
|
cell_size_x=20,
|
|
cell_size_y=20,
|
|
window=window
|
|
)
|
|
|
|
window.mainloop()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|