Reputation: 45
Lets say I have a 2D board where I have a games like Tetris had or Conveys Game of Life.
Is there is a way to reprint the whole 2D board over and over at the same place, be that shell or tkinter window (new to tkinter).
For 2D array output, I have a function print_2d_arr(arr) that simply loops through and prints each line one by one.
I've found multiple questions that either flush or use end="" approaches for single line replacement, or status bar creation, but really want to know if there is a simple and elegant command to do that, because whenever I tried to apply those techniques they kind of not applicable for my individually print_2d_arr function that outputs multiple lines simultaneously.
Thanks!
Upvotes: 1
Views: 44