python project for fact ip address⚡️

1 min read

what we use in python to fact ip is a module called socket
import socket
next use inside method
computer_name = socket.gethostname()
next create a one more getip variable to fact a ip form hostanme
getip= socket.gethostbyname(computer_name)
then use print and get your ip
print( "computer name: " + computer_name )
print("my ip is : " + getip)
full structure of code
get a full code from my github repositorie
https://github.com/santyadavcoder/ip-address-fact-in-python
and your result is display on your console
thanks you read 🫶🏻
1
Subscribe to my newsletter
Read articles from Santosh Yadav directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Santosh Yadav
Santosh Yadav
sant ⚡️ Radhe Radhe 🫶🏻