Answer the question
In order to leave comments, you need to log in
Python: how to execute a script in multiple threads?
Comrades, please tell me about this issue: I use python to automate and simplify the administration of linux servers, and then the question arose - how can I execute commands in several threads?
Suppose you need to execute a command on several servers, my knowledge is enough to write all the servers to the list and loop through it, executing the command in turn on each machine, which is naturally several times longer than executing the command simultaneously on all machines. I simply do not have enough knowledge - how to do this it is necessary to contain a list of servers and how, in this case, you can run a command on each of them. So far, I have not even been able to properly formulate the question briefly in order to ask it to Google. Tell me please.
Answer the question
In order to leave comments, you need to log in
Not sure, but you can try to dig into Celery . I also googled the following question - I hope it helps in some way in finding a solution
What if you execute a command and execute the next one without waiting for it to complete?
For example, in bash, the "&" operator is used for this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question