Advertisement
skip420

sockit

Sep 9th, 2022 (edited)
1,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. # python3 Sockit.py
  2.  
  3. # those of you who have multiple socket.py files? rename them or you'd find a lot of conflicts!
  4.  
  5.  
  6. import socket
  7. s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  8. s.connect(("8.8.8.8", 80))
  9. print(s.getsockname()[0])
  10. s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement