get external ip python
# This example requires the requests library be installed. You can learn more # about the Requests library here: http://docs.python-requests.org/en/latest/ from requests import get ip = get('https://api.ipify.org').text print 'My public IP address is:', ip
Source: stackoverflow.com
get IP address python
import socket hostname = socket.gethostname() IPAddr = socket.gethostbyname(hostname) print("Your Computer Name is:" + hostname) print("Your Computer IP Address is:" + IPAddr) #How to get the IP address of a client using socket
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
python get ip info
import requests req = requests.get('https://utilities.tk/network/info?ip=1.1.1.1') print(req.status_code) print(req.text)
Source: github.com