3 ms·
Using this python script to make the int-ip-address: #!/usr/bin/env python import socket import struct def ip2long(ip): packedIP = socket.inet_aton(ip)
by Leask 13y ago
Using this python script to make the int-ip-address:
#!/usr/bin/env python
import socket
import struct
def ip2long(ip):
packedIP = socket.inet_aton(ip)
return struct.unpack("!L", packedIP)[0]
print ip2long('192.241.224.102') # your website ip address
# or download it on github: https://gist.github.com/Leask/7075483 https://gist.github.com/Leask/7075483
- d0mine 13y agoOr more straightforward in Python 3.3+: import ipaddress print(int(ipaddress.ip_address('192.241.224.102')))