1import socket
2hostname = socket.gethostname()
3IPAddr = socket.gethostbyname(hostname)
4print("Your Computer Name is:" + hostname)
5print("Your Computer IP Address is:" + IPAddr)
6#How to get the IP address of a client using socket
1import socket
2host_name = socket.gethostname()
3IPAddress = socket.gethostbyname(host_name)
4print("Your Computer Name is:" + host_name)
5print("Your Computer IP Address is:" + IPAddress)
6#How to get the IP address of a client using socket module