Answers for "How do I run two python loops concurrently?"

0

How do I run two python loops concurrently?

from multiprocessing import Process

def loop_a():
    while 1:
        print("a")

def loop_b():
    while 1:
        print("b")

if __name__ == '__main__':
    Process(target=loop_a).start()
    Process(target=loop_b).start()
Posted by: Guest on October-03-2021

Python Answers by Framework

Browse Popular Code Answers by Language