How do I run two python loops concurrently?
Answers
Answered by
2
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
Science,
6 months ago
Computer Science,
6 months ago
English,
1 year ago
English,
1 year ago
Social Sciences,
1 year ago