Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created June 4, 2015 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekoya/db2c42612da20c3f785f to your computer and use it in GitHub Desktop.
Save nekoya/db2c42612da20c3f785f to your computer and use it in GitHub Desktop.
import subprocess
import sys
import time
p = subprocess.Popen(
('redis-server', '--port', '6379', '--bind', '127.0.0.1'),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
WAIT = 0.001
for i in xrange(100):
if p.poll() is not None:
print WAIT * i
sys.exit(0)
time.sleep(WAIT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment