两个 pygame windows 运行 并排

Two pygame windows running alongside each other

我正在使用 eztext 为我的程序收集输入,但输入 window 阻止打开输出 window(我无法看到显示,直到输入 window 已关闭)

非常感谢对上述问题的任何帮助,在互联网上进行了长时间的拖网搜索后,我似乎找不到任何可以修改以适合我的目的的解决方案,但如果有人看到我遗漏的任何内容, 我将不胜感激 link.

再次感谢

A.J.P

您应该尝试使用 2 个线程:一个用于第一个 window,第二个用于另一个。这样,两个 window 都会打开。 编辑: 例如,这两个线程将与一个列表通信。但我最好使用 类:

from time import sleep
from threading import Thread

informations = []

def funct_a (informations):
    while (1):
        sleep (0.5)
        print informations

def funct_b (informations):
    a = 0
    while (1):
        sleep (1)
        informations.append (a)
        a += 1

Thread (target = funct_a, args = (informations, )).start ()
Thread (target = funct_b, args = (informations, )).start ()