How to update a printed message in terminal without reprinting

后端 未结 8 2161
时光取名叫无心
时光取名叫无心 2020-11-29 02:50

I want to make a progress bar for my terminal application that would work something like:

 [XXXXXXX       ] 

which would give a visual indi

8条回答
  •  我在风中等你
    2020-11-29 03:27

    It's a different language, but this question might be of assistance to you. Basically, the escape character \r (carriage Return, as opposed to \n Newline) moves you back to the beginning of your current printed line so you can overwrite what you've already printed.

提交回复
热议问题