Skip to content
← Back to Community
how to make an ip logger in python
Profile icon
Kloco12

import socket

def get_Host_name_IP():
try:
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
print("Hostname : ",host_name)
print("IP : ",host_ip)
except:
print("Unable to get Hostname and IP")

get_Host_name_IP()

Voters
Profile icon
johncena44
Profile icon
YouPain
Profile icon
AgainstTheWest
Profile icon
FagnerR
Profile icon
cmglj
Profile icon
Kloco12