1

I am trying to build a game.
The game will have an item called a "pulsating crystal" (I am using \033[1;31;40m] to change the items colour), I want to it to be rainbow, so it keeps changing colours, without deleting everything else in the terminal. I used print(\033c) to clear the terminal but I just want to print the last line. I am sorry if the question is unclear or repetitive, or has another answer but I couldn't find another clear answer for my problem. PS I use Linux.

Dom
  • 11
  • 2

1 Answers1

0

I just want to print the last line.

To print a line repeatedly, just override the line ending \n by giving the keyword argument end='\r' to print().

Armali
  • 18,255
  • 14
  • 57
  • 171