Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement