Having further google I have found this
def pingComputer():
import os
hostname = input("Enter the ip address: ")
response = os.system("ping -c 1 " + str(hostname))
if response == 0:
print hostname, 'is up!'
else:
print hostname, 'is down!
Will this perform the Ping?
Oh Yes it Will!!