Python ping-pong helper