为什么我的后端代码仅在我关闭GUI后才开始运行?

时间:2019-01-16 10:55:34

标签: python python-3.x user-interface

我有一个GUI,并且有一些后端代码,但是它们并不想一起工作。

我尝试了很多随机的东西,例如多线程(尽管这应该足够慢才能不需要该概念),但是我不知道我在做什么,所以任何帮助都将是惊人的,谢谢!

处理程序:

class get_Icon_Instance():
    def __init__(self):
        while True:
            icon_service = IconService(HTTPProvider("https://ctz.solidwallet.io/api/v3"))
            block = icon_service.get_block("latest")['confirmed_transaction_list']
            print(block[0]['to'])

gui:

class openWindow(object):
    def __init__(self, master, **kwargs):

        self.master=master
        pad=3
        self._geom='200x200+0+0'
        x = master.winfo_screenwidth()-pad
        y = master.winfo_screenheight()-pad
        master.geometry("{0}x{1}+0+0".format(
            x, y))
        master.bind('<Escape>',self.toggle_geom)
        self.layout(x,y)

我希望程序输出一个哈希值,但是仅当我关闭GUI时才会发生,无论我尝试运行该程序的顺序如何,因为GUI始终首先显示并停止处理程序运行,除非我手动关闭GUI。

0 个答案:

没有答案