Created
August 11, 2014 03:46
-
-
Save mygeekdaddy/acdf262b804160ce7d9d to your computer and use it in GitHub Desktop.
Print current IP address of system
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/python | |
import socket | |
fqdn = socket.getfqdn() | |
ip_addr = socket.gethostbyname(fqdn) | |
print ip_addr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment