subprocess.Popen(cmd) question

WolfgangZ wollez at gmx.net
Fri Aug 10 07:38:28 EDT 2007


WolfgangZ schrieb:
> Hello,
> 
> I'm starting some subprocesses inside a loop. The processes run 
> independent and dont need any communication between each other. Due to 
> memory issues I need to limit the number of running processes to around 
> 10. How can I insert a break into my loop to wait until some processes 
> are finished?
> 
> Some minimal examplecode:
> 
> import subprocess
> for i in range(0,100):
>      cmd='ping localhost'
>      p=subprocess.Popen(cmd)
>      p.wait()
> 
> Thanks for any ideas.
> 
> Wolfgang
> 

Problem solved by using "threading"

Wolfgang




More information about the Python-list mailing list