mynode/rootfs/standard/usr/bin/get_local_ip.py
2019-12-05 21:30:23 -06:00

9 lines
151 B
Python
Executable File

#!/usr/bin/python3
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
print(s.getsockname()[0])
s.close()