-2
I’m trying to run parallel scripts in Python, using the threading library, but I’m not being able to apply it to my case. I believe the problem is to receive my function, but even creating a list, it returns the error. I’m having trouble executing the function.
import threading
import os
def inicia_programa(args):
for nome_arquivo in args:
os.system('py -3.8 {}'.format(nome_arquivo))
if __name__ == "__main__":
arquivos = ['Script1','Script2','Script3']
processos = []
for arquivo in arquivos:
processos.append(threading.Thread(target=inicia_programa, args=('Script1','Script2','Script3)))
for processo in processos:
processo.start()
Now it has worked out in a satisfactory way. Thank you
– Luiz Mendes