我从代码中摘录了问题仍然存在的地方。我相信这是因为我的slow\u type函数,但是当对话是“slow-typed”时,我的输入将接受在“slow\u type”期间输入的任何值,甚至在输入出现之前。我希望输入只能在slow\u type函数完成后才能输入。我该怎么做?你知道吗
import time
import sys
def slow_type(line, speed):#You input the dialogue and speed(smaller = faster)
for l in line:
sys.stdout.write(l)
sys.stdout.flush()
time.sleep(speed)
time.sleep(.5)
NL1 = "Huh, I see you finally came. "
NL2 = "You know I sent you that message a long time ago.\n"
NL3 = "But I guess you are here now, and that's what matters. "
NL4 = "So...\n"
NL5 = "\n\t\t\t\tAre you ready?\n\n"
slow_type(NL1, .05)
slow_type(NL2, .05)
slow_type(NL3, .05)
slow_type(NL4, .2)
slow_type(NL5, .05)
print("\t\t1:Yes, I am. 2:Who are you? 3:No, I am leaving.\n")
first_choice = input("\t\t\t\t ").lower()
我使用的是windows10cmd。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐