How to schedule system calls with Python

Christian Heimes lists at
Fri Oct 16 12:21:41 CEST 2009

MRAB wrote:
> You could use multithreading: put the commands into a queue; start the
> same number of worker threads as there are processors; each worker
> thread repeatedly gets a command from the queue and then runs it using
> os.system(); if a worker thread finds that the queue is empty when it
> tries to get a command, then it terminates.

Threads aren't necessary here and the OP shouldn't use os.system()
either. The subprocess module is superior and makes the solution much
either without the need for threads.


More information about the Python-list mailing list