Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import thread
- from vii.camera import Camera
- class Process(object):
- def __init__(self, width=800, height=600):
- self._cam = Camera(width, height)
- self._is_running = False
- self._current_image = None
- def start(self):
- thread.start_new(self._run(), (self))
- def _run(self):
- self._cam.start()
- self._is_running = True
- while self._is_running:
- self._current_image = self._cam.update()
- self._current_image.show()
- def get_image(self):
- return self._current_image
- def stop(self):
- self._is_running = False
- self._cam.close()
- thread.exit()
- process = Process()
- process.start()
- print("You will never see this output")
- while (True):
- key = raw_input()
- if key == 'q':
- process.stop()
- break
Add Comment
Please, Sign In to add comment