python handling subprocess
<p>I am running an <code>os.system(cmd)</code> in a for loop. Since sometimes it hangs, I am trying to use <code>process=subprocess.pOpen(cmd)</code> in a for loop. But I want to know the following: 
- If I do <code>sleep(60)</code> and then check if the process is still running by using <code>process.poll()</code>, how do I differentiate between process actually running even after 1 minute and process that hung? 
- If I kill the process which hung,will the for loop still continue or will it exit? </p>

<p>Thanks!</p>
