我在python 程序里写了一个uithread:
class UiThread(threading.Thread):
def run(self):
while True:
time.sleep(1)
print(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime()))
oper=input('input your choice:')
print(oper)
主程序:
ui = UiThread()
ui.setDaemon(True)
ui.start()
while True:
api.wait_update()
#api是别人提供的,按照他们的逻辑时不时提供激励,使主程序循环运行,不提供 #激励时就会在wait_update()里阻塞了
api.close()
sys.exit(0)
我想在半夜一点半的时候给uithread提供一个输入oper,应该如何操作?半夜里肯定没有激励的,另外创建一个thread做定时器或者在系统里的Cron都可以,怎样给uithread输入oper呢?
--
修改:luchu FROM 119.251.17.*
FROM 119.251.17.*