Advertisement
Guest User

Untitled

a guest
May 17th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import subprocess, threading, time
  2. can_break = False
  3.  
  4. def run():
  5.     args = ["localtunnel", "8000"]
  6.     popen = subprocess.Popen(args)
  7.     popen.wait()
  8.     print '%s ended with return code: %d' % (args[0], popen.returncode)
  9.  
  10. t = threading.Thread(target=run)
  11.  
  12. try:
  13.     t.start()
  14.     while True:
  15.         print 'Main thread...'
  16.         time.sleep(1)
  17. except KeyboardInterrupt:
  18.     can_break = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement