2
我想編寫一個程序,它將每秒鐘打印一個字符串,另一方面它將允許用戶編寫文本,我在下面的代碼片段。我的問題是每次打印新行時,輸入行也受到干擾。有沒有辦法將輸入線與輸入線分開?不斷使用python多線程獲取輸入
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>")