mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-15 09:59:16 +00:00
9 lines
151 B
Python
9 lines
151 B
Python
|
#!/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()
|