Add modules/ip_address.py

This commit is contained in:
Xargana 2025-05-16 15:39:31 +02:00
parent 23fc0d976a
commit 8fb51d7a53

11
modules/ip_address.py Normal file
View file

@ -0,0 +1,11 @@
import socket
def get_ip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
s.close()
except Exception:
ip = "No Connection"
return f"IP: {ip}"