Guest User

Untitled

a guest
Nov 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import socket
  4. import struct
  5. import sys
  6.  
  7. #value = 191041708
  8. def to_ipaddr(value):
  9. packed = socket.ntohl(value)
  10. x = struct.pack('!I', packed)
  11. return socket.inet_ntoa(x)
  12.  
  13. if __name__ == '__main__':
  14. value = int(sys.argv[1])
  15. print(to_ipaddr(value))
Add Comment
Please, Sign In to add comment