def handle_ps3_controller(hid, ipaddr): print "Received connection from a Sixaxis PS3 Controller" csock = hid.get_control_socket()[0] isock = hid.get_interrupt_socket()[0] sixaxis = PS3SixaxisThread(csock, isock, ipaddr) add_thread(sixaxis) sixaxis.start() return