#!/usr/bin/env python
import socket
import struct
def ip2long(ip):
packedIP = socket.inet_aton(ip) return struct.unpack("!L", packedIP)[0]
# or download it on github: https://gist.github.com/Leask/7075483
import ipaddress print(int(ipaddress.ip_address('192.241.224.102')))
#!/usr/bin/env python
import socket
import struct
def ip2long(ip):
print ip2long('192.241.224.102') # your website ip address# or download it on github: https://gist.github.com/Leask/7075483