def proc(uid, sock): h = HOMER(sock) while 1: conn = httplib.HTTPConnection(SERVER) req = '/dcu?uid=%s&get=motors' % uid res = conn.request('GET', req) res = conn.getresponse() if res.status == 200: c = simplejson.loads(res.read()) h.setTrackControl(c[0], c[1]) time.sleep(1)