Skip to content

Instantly share code, notes, and snippets.


ChrisGuest ChrisGuest

  • Melbourne, Australia
View GitHub Profile
pklaus /
Last active Sep 22, 2022
Python: List all Network Interfaces On Computer
Determine IPv4 addresses on a Linux machine via the socket interface.
Thanks @bubthegreat the changes to make it Py2/3 compatible and the helpful
code comments:
This version has all comments removed for brevity.
import socket
import array
import struct