port = 9123 try: subprocess.Popen(["python", "webcamserver.py", "%d" % port], shell=False, stdin=None, stdout=None, stderr=None, close_fds=True) except: print "unable to spawn" exit(1) time.sleep(1) s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('4.2.2.1', 123)) ip = s.getsockname()[0] wc = Webcam(ip, port) # # connect to a specific camera # rc, xml = wc.connect("/dev/video0") if not rc: exit(1) print "Connect: ", xml # # change attributes