Subscribe Us

Header Ads

How to Get Host name and ip address using python in 4 lines of code | Python projects|

Hey guys in this video i am gonna tell you how you can get ip address and host name using python ..



Source code...

#required module -inbuilt module
import socket
#for getting host name host_name = socket.gethostname() print(host_name)
#for ip address ip_address = socket.gethostbyname(host_name) print(ip_address)


Post a Comment

0 Comments