📜  python代码示例中的延迟打印

📅  最后修改于: 2022-03-11 14:45:49.292000             🧑  作者: Mango

代码示例1
>>> import time
>>> import sys
>>> blah = "This is written slowly\n"
>>> for l in blah:
...   sys.stdout.write(l)
...   sys.stdout.flush()
...   time.sleep(0.2)
...
This is written slowly