Advertisement
nux95

Untitled

Mar 11th, 2013
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1.  
  2. import c4d
  3. import time
  4. import threading
  5.  
  6. def printer(interval=1):
  7.     printer.running = True
  8.     while printer.running:
  9.         print "printer() loop"
  10.         time.sleep(interval)
  11.  
  12. def main():
  13.     thread = threading.Thread(target=printer)
  14.     thread.start()
  15.  
  16.     # time intensive stuff
  17.  
  18.     printer.running = False
  19.     thread.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement