【发布时间】:2019-12-17 10:11:02
【问题描述】:
import time
while True:
time.sleep(1)
print(".", end=" ")
我只是想通过在一秒钟后出现点来制作一种加载屏幕,我期待 这-
.{wait}.{wait}.{wait}.{wait}
但是我没有得到任何输出,但是通过 ctrl + c 关闭程序后,我得到了这样的输出-
. . . . . . . . . . . . Traceback (most recent call last):
File "c:/Users/Piyush/Desktop/Python/dotdotdotload.py", line 12, in <module>
time.sleep(1)
KeyboardInterrupt```
【问题讨论】:
-
尝试使用
print(".", end=" ", flush=True) -
它有效,XD 非常感谢!
标签: python python-3.x python-2.7