Files
Tank-Transfer-Station/tanktransfer/python-driver/utilities.py
Patrick McDonagh 0431e764cd Completes MAXH2O-53, starts MAXH2O-57
Completes IO programming.
Adds framework for pocloud driver from cookiecutter
2017-12-06 16:58:06 -06:00

12 lines
286 B
Python

"""Utility functions for the driver."""
import socket
def get_public_ip_address():
"""Find the public IP Address of the host device."""
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
s.close()
return ip