Made the ping/pong example Python 3 compatible

I just made the ping/pong example Python 3 compatible. It still works as intended with Python 2.7 .

Are you interested by the conversion of other examples to Python 3?