Autore: Fabio Di Matteo
Ultima revisione: 03/05/2023 - 15:26
#!/usr/bin/env python3 import socket import os def getLocalIp(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) ip= s.getsockname()[0] s.close() return ip os.system('zenity --title "Il tuo indirizzo ip" --text "Il tuo IP principale" --entry --entry-text "%s"' % getLocalIp())