我想写一个程序,它将打印一个字符串每秒钟另一方面,它将允许用户写文本,我有下面的代码片段。我的问题是每次打印新行时,输入行也会受到干扰。有没有办法把输出线和输入线分开?你知道吗
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>")
Tags:
我怀疑没有^{} 你能做到这一点。也许还有别的办法,但我觉得不太好。有一个基本的操作方法here。你知道吗
相关问题 更多 >
编程相关推荐