A simple version of ping in Python