get the current IP adress


PHOTO EMBED

Thu Dec 31 2020 15:52:11 GMT+0000 (UTC)

Saved by @houch841 #python

import socket

# get the current IP adress
def get_ip_adress():
   ip_address = '';
   s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   s.connect(("8.8.8.8",80))
   ip_address = s.getsockname()[0]
   s.close()
   return (ip_address)           
content_copyCOPY