
Untitled
By: a guest on
May 17th, 2012 | syntax:
Python | size: 0.40 KB | hits: 20 | expires: Never
import subprocess, threading, time
can_break = False
def run():
args = ["localtunnel", "8000"]
popen = subprocess.Popen(args)
popen.wait()
print '%s ended with return code: %d' % (args[0], popen.returncode)
t = threading.Thread(target=run)
try:
t.start()
while True:
print 'Main thread...'
time.sleep(1)
except KeyboardInterrupt:
can_break = True