Print in one line dynamically

后端 未结 20 3245
梦谈多话
梦谈多话 2020-11-21 23:32

I would like to make several statements that give standard output without seeing newlines in between statements.

Specifically, suppose I have:

for it         


        
20条回答
  •  自闭症患者
    2020-11-21 23:57

    Another answer that I'm using on 2.7 where I'm just printing out a "." every time a loop runs (to indicate to the user that things are still running) is this:

    print "\b.",
    

    It prints the "." characters without spaces between each. It looks a little better and works pretty well. The \b is a backspace character for those wondering.

提交回复
热议问题