Answers for "get host ip socket python"

1

get ip python

import socket    
host = socket.getfqdn()    
addr = socket.gethostbyname(host)
print(f"Your ip is {addr}")
# On Linux, it may give you the localhost address
Posted by: Guest on November-18-2020

Python Answers by Framework

Browse Popular Code Answers by Language