ip address and host name

Used socket to get the ip address and host name. We kept the code inside try & except for exception handling.
import socket
try: 
        my_host = socket.gethostname() 
        my_ip = socket.gethostbyname(my_host) 
        print("Hostname :  ",my_host) 
        print("IP : ",my_ip) 
except: 
        print("Unable to get Hostname and IP address")
The output will change based on your hosting server.

PHP Script to display IP address.
All Built in Functions in Python bin() complex()


plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer