how to get local ip in python
import socket
local_ip = socket.gethostbyname(socket.gethostname)
print(f"[+] Your Local IP is : {local_ip}")
how to get local ip in python
import socket
local_ip = socket.gethostbyname(socket.gethostname)
print(f"[+] Your Local IP is : {local_ip}")
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.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us