multiple prints on the same line in Python

前端 未结 17 2455
独厮守ぢ
独厮守ぢ 2020-11-22 06:06

I want to run a script, which basically shows an output like this:

Installing XXX...               [DONE]

Currently, I print Installi

17条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 06:19

    Print has an optional end argument, it is what printed in the end. The default is a newline, but you can change it to empty string. e.g. print("hello world!", end="")

提交回复
热议问题