Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.