Ejemplo n.º 1
0
def webcam_service(queue):
    cam = VirtualWebcam()
    cam.start()

    while True:
        import time

        time.sleep(1)
        try:
            msg = queue.get()
        except (QueueEmpty, IOError):
            continue

        try:
            msg.apply(cam)
        except AttributeError:
            pass
        except StopServiceException:
            cam.pause()
            return
Ejemplo n.º 2
0
from virtual_webcam import VirtualWebcam
import time

cam = VirtualWebcam()
cam.start()

start = time.time()
i = 0
while True:
    # text = raw_input("What?")
    time.sleep(0.1)
    i += 1
    cam.change_text("x:{0}, total: {1}".format(i, int(time.time() - start)))