선 밖에 선 자유인

IP <-> Decimal in Python3 본문

IT/Programming

IP <-> Decimal in Python3

Hotman 2018. 2. 23. 12:19

- python3 


>>> import ipaddress

>>> int(ipaddress.ip_address('192.168.0.1'))

3232235521

>>> ipaddress.ip_address(3232235521)

IPv4Address('192.168.0.1')

>>> int(ipaddress.ip_address(3232235521))

3232235521

>>> 


Comments