The phidget exceptions are probably occurring because you're trying to get or set an output that is not presently attached. Try running your Python code using a powered USB hub or on a computer with separately powered USB ports. When I did this with your code I had zero exceptions in an hour.