how to know my main ip using python code example
Example: 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
import socket
host = socket.getfqdn()
addr = socket.gethostbyname(host)
print(f"Your ip is {addr}")
# On Linux, it may give you the localhost address