mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-16 02:12:49 +00:00
6 lines
130 B
Python
6 lines
130 B
Python
|
import socket
|
||
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||
|
s.connect(("8.8.8.8", 80))
|
||
|
print(s.getsockname()[0])
|
||
|
s.close()
|