-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_Thread.py
More file actions
39 lines (28 loc) · 964 Bytes
/
Copy pathmain_Thread.py
File metadata and controls
39 lines (28 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from threading import Thread
from subprocess import call
from sys import executable
from Aplication_Att import Visualizar_att
from Aplication_eventos import verificar_duplo_click
from time import sleep
def inicia_programa(nome_arquivo):
call([executable, f'{nome_arquivo}'])
# Ex: os.system('py -3.7 x.py')
p = Visualizar_att()
d= False
if __name__ == "__main__":
d= False
arquivos = [r'C:\Users\breno\Desktop\Projetos\Soldas\aplication_gui_basic.py',
r'C:\Users\breno\Desktop\Projetos\Soldas\aplication_gui_event.py']
processos = []
for arquivo in arquivos:
if 'event' in arquivo:
d = True
processos.append(Thread(target=inicia_programa, args=(arquivo,), daemon=d))
processos[0].start()
processos[1].start()
while True:
if verificar_duplo_click():
p.evento_duplo_click()
if not processos[0].is_alive():
break
sleep(0.1)