Created
June 29, 2015 16:41
-
-
Save ehermes/11feb1ab2a83b0fd6a8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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