Created
February 7, 2018 19:25
-
-
Save tzhenghao/9d64db44b3d1f465a914000649d233d1 to your computer and use it in GitHub Desktop.
A simplified version of getting an IP address of a machine
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
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