我想编写一个程序,它每秒打印一个字符串,另一方面它允许用户编写文本,我有下面的代码片段。我的问题是每次打印新行时,输入行也会受到干扰。有没有办法将输出线与输入线分开?
import time
from thread import start_new_thread
def heron():
while 1:
time.sleep(1)
print "some text"
start_new_thread(heron,())
c = raw_input("Enter text>")
最佳答案
关于python - 使用python多线程不断获取输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9486136/