Printing on the same line on a jupyter notebook

前端 未结 3 1889
-上瘾入骨i
-上瘾入骨i 2020-12-05 18:19

In python 3, we can easily print on the same line using the following script. I use this to understand the progress of my loop (how much time will be left). However, in jupy

3条回答
  •  难免孤独
    2020-12-05 19:18

    Prefix a \r and add an argument end="" to print, like so

    print("\rThis will be printed on the same line", end="")

    This works in the Jupyter notebook in Google Colab.

提交回复
热议问题