import socket
from pythonping import ping
hostname = socket.gethostname()
IP = socket.gethostbyname(hostname)
I=str(IP)
res=""
if ping(I, verbose=False)[0].success:
res="Successful!"
else:
res='Fail!'
print(res)
TypeError: 'ResponseList' object is not subscriptable