【发布时间】:2023-02-11 18:10:12
【问题描述】:
我正在尝试将一个 python3 程序放入 Tkinter GUI 中,该程序控制我的池并在 Main 中运行 5 个队列,但 tkinter 阻止了队列。如何让功能在后台运行,界面始终在最前面??? 我不是专家!!
这就是我试图放入 GUI 中的内容 enter image description here
`if __name__ == '__main__':
setup()
queue = Queue()
filtime = Thread(target=filtime, args=(queue,))
filtime.start()
get_motion = Thread(target=get_motion, args=(queue,))
get_motion.start()
gettemps = Thread(target=gettemps, args=(queue,))
gettemps.start()
Frostcheck = Thread(target=Frostcheck, args=(queue,))
Frostcheck.start()
try:
filtime.join()
get_motion.join()
gettemps.join()
Frostcheck.join()
except KeyboardInterrupt:
print("Program Halted")
Log('Program Halted')
GPIO.cleanup()
exit() `
【问题讨论】:
-
您的示例代码的缩进需要修复。
标签: python-3.x tkinter