Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python socket get client ip address

1. Import the socket module.
2. Get the hostname using the socket.gethostname() method and store it in a variable.
3. Find the IP address by passing the hostname as an argument to the
socket.gethostbyname() method and store it in a variable.
4. Print the IP address.
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #python #socket #client #ip #address
ADD COMMENT
Topic
Name
9+7 =