I'm writing a program where I want the cursor to print letters on the same line, but then delete them as well, as if a person was typing, made a mistake, deleted back to the mistake, and kept typing from there.
All I have so far is the ability to write them on the same line:
import sys, time
write = sys.stdout.write
for c in text:
write(c)
time.sleep(.5)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…