fengshenzhitui 发表于 2021-2-2 16:26:31

_2_ 发表于 2021-2-2 16:26:32

听说你想实现这个?
import time as t

print("不要眨眼!", end="\r")
t.sleep(2)
print("你打印了个寂寞")

hrp 发表于 2021-2-2 17:17:19

本帖最后由 hrp 于 2021-2-2 18:20 编辑

或许你是想实现这个?
import time

string = "asdfasdfadsfdagfsgafdg"
print(string, end='\r')
time.sleep(3)
print('' * len(string), end='\r')
print(123)

Newbie_XZW 发表于 2021-2-2 23:24:49

import time
var = "asdfasdfadsfdagfsgafdg"
lang = len(var)
clear, stoptimer = 0, 3
for i in range(2):
    print("\r" + var[:lang - clear], end="")
    clear = lang
    time.sleep(stoptimer)
    stoptimer = 0.5

print()
print(123)

把你的stoptimer改改就可以实现功能了,至于原因是啥,每个人有每个人的见解
页: [1]
查看完整版本: 等待时间后,删除print打印内容