[Python] I'm trying to get two functions to run at the same time

Discussão em 'Python' iniciado por Stack, Agosto 13, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to get my script to run two functions at the same time. But what happens is function2 will not start until function1 finishes.

    import multiprocessing
    process1 = multiprocessing.Process(target=function1())
    process1.start()
    process2 = multiprocessing.Process(target=function2())
    process2.start()
    process3 = multiprocessing.Process(target=function3())
    process3.start()

    process1.join()
    process2.join()
    process3.join()

    Continue reading...

Compartilhe esta Página