我想编写一个程序,它每秒打印一个字符串,另一方面它允许用户编写文本,我有下面的代码片段。我的问题是每次打印新行时,输入行也会受到干扰。有没有办法将输出线与输入线分开?
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>")
请您参考如下方法:
