Computer Science, asked by ankurdrall5496, 1 year ago

How do I run two python loops concurrently?

Answers

Answered by Anonymous
2
 \huge \mathbb{Heya \: \: Answer}

If you want concurrency, here's a very simple example:

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()
This is just the most basic example I could think of
Similar questions