import threading #if you haven't already, as I said I can't look at your link atm
def show_notes(*args,**kwargs):
# whatever you already have implemented here that that button calls
class Update(threading.Thread):
from time import sleep
daemon = True
def run(self):
while True:
show_notes()
sleep(2)
tick = Update()
tick.start()
我实际上无法查看源材料,因此这可能是完全错误的,在这种情况下,我将删除。不如使用
Thread
每隔几秒钟继续调用Show Notes函数?有点像。。。。你知道吗这是一个丑陋的实现,因为基本上你要求每两秒钟就有一个完整的SQL服务器转储,但是对于非常小的数据库,它可以做你想做的事情。如果您有比这更大的内容,您可能希望更改添加注释的方式,以便将它们作为更改放在
Queue
中,然后让您的ListBox
在Queue
中运行,并从服务器中逐个提取每个新提交。你知道吗相关问题 更多 >
编程相关推荐