Advertisement
TTpocToXaKep

Getting local ip adress

Jan 30th, 2023 (edited)
906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. import socket
  2. hostname = socket.gethostname()
  3. IPAddr = socket.gethostbyname(hostname)
  4. print("Your Computer Name is:" + hostname)
  5. print("Your Computer IP Address is:" + IPAddr)
Tags: Ip #ip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement