Skip to content

Instantly share code, notes, and snippets.

@ehermes
Created June 29, 2015 16:41
Show Gist options
  • Select an option

  • Save ehermes/11feb1ab2a83b0fd6a8b to your computer and use it in GitHub Desktop.

Select an option

Save ehermes/11feb1ab2a83b0fd6a8b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import subprocess
import time
proc = subprocess.Popen(['sleep','5'])
while proc.poll() is None:
print "Not done yet!"
time.sleep(1)
else:
if proc.poll() != 0:
print "Something went wrong! Returned with code {}".format(proc.poll())
else:
print "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment