Created
August 18, 2020 01:20
-
-
Save Esl1h/c40b1b6afa529e35e930da5429b8f4f0 to your computer and use it in GitHub Desktop.
Python converting decimal to IPv4 using ipaddress module (in databases IPv4 are recorded as decimal, mostly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.8 | |
import ipaddress | |
decip = 2887123457 # Example for 172.22.2.1 | |
ip = str(ipaddress.IPv4Address(decip)) | |
print(ip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment