“Imprimer IP Python” Réponses codées

Obtenir l'adresse IP 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
Clumsy Caterpillar

Python obtenir des informations IP

import requests

# get your current public ip's info:
req = requests.get('https://utilities.tk/network/info')

# or specify an ip to check
req = requests.get('https://utilities.tk/network/info?ip=1.1.1.1')

print(req.status_code)
print(req.json())
ProxyBlade

Comment obtenir une IP d'utilisateur dans Python

import socket    
host_name = socket.gethostname()    
IPAddress = socket.gethostbyname(host_name)    
print("Your Computer Name is:" + host_name)    
print("Your Computer IP Address is:" + IPAddress) 
#How to get the IP address of a client using socket module
Stupid Sheep

Imprimer IP Python

import requests

# Prints public IPv4 address:
print(requests.get('https://utilities.tk/network/info').json()['ip'])

# Prints more info like location, hostname etc
print(requests.get('https://utilities.tk/network/info').json())
ProxyBlade

Réponses similaires à “Imprimer IP Python”

Questions similaires à “Imprimer IP Python”

Plus de réponses similaires à “Imprimer IP Python” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code