——
代碼
def slowprint(text,times = 0.1):
import time
for i in text:
print(i,flush = True,end = "")
time.sleep(times)
作用
flush = True是什麼?
flush在print裏默認是False(非實時打印)
小明:那flush = True是實時打印咯?
沒錯。
小結
今天我們知道了flush,還知道了它的作用。
def slowprint(text,times = 0.1):
import time
for i in text:
print(i,flush = True,end = "")
time.sleep(times)
flush = True是什麼?
flush在print裏默認是False(非實時打印)
小明:那flush = True是實時打印咯?
沒錯。
今天我們知道了flush,還知道了它的作用。
繼續運行 🥋 回憶上次內容 上上次 真寫了 萬行 代碼 這 萬行 代碼 都是寫在 明面 上的 這次 使用git命令 下載了 github上面的倉庫