python print one line same space

前端 未结 4 2139
悲&欢浪女
悲&欢浪女 2021-01-26 14:06

I need to print \'ok\' in same place. Any ways to do it?

I\'ve found solutions but they don\'t works with IDLE correctly:

 while (count < 9):
      if         


        
4条回答
  •  灰色年华
    2021-01-26 14:28

    For example, if you want to print "OK" in the exact same spot, you can do :

    for i in range(0, 10000):
        print("\rOK", end='')
    

    Result :

    OK
    

    worte 10000 times on the same console spot.

提交回复
热议问题