Skip to content

Instantly share code, notes, and snippets.

@tzhenghao
Created February 7, 2018 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzhenghao/9d64db44b3d1f465a914000649d233d1 to your computer and use it in GitHub Desktop.
Save tzhenghao/9d64db44b3d1f465a914000649d233d1 to your computer and use it in GitHub Desktop.
A simplified version of getting an IP address of a machine
import socket
def get_ip_addresses_v2():
return socket.gethostbyname(socket.gethostname())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment