Last active
July 1, 2021 06:37
-
-
Save ethinx/7636432 to your computer and use it in GitHub Desktop.
inet_addr in Python
This file contains hidden or 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
| python -c 'import socket,struct; print(hex(struct.unpack("<L", socket.inet_aton("127.0.0.1"))[0]))' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are missing a closing paren at the end and misspelled "struct" :(
python3 -c 'import socket,struct; print(hex(struct.unpack("<L", socket.inet_aton("127.0.0.1"))[0]))'would work