Skip to content

Instantly share code, notes, and snippets.

@mygeekdaddy
Created August 11, 2014 03:46
Show Gist options
  • Save mygeekdaddy/acdf262b804160ce7d9d to your computer and use it in GitHub Desktop.
Save mygeekdaddy/acdf262b804160ce7d9d to your computer and use it in GitHub Desktop.
Print current IP address of system
#!/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