Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to get ip address of pc using python

import socket
hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)

print(local_ip)

#it's work
Comment

how to get the ip address of laptop with python

#firstly import socket
import socket
#it is important to get host name get it
host_name = socket.gethostname()
ip_adress = socket.gethostbyname()
print("Ip address of",hostbyname,"is",ip_adress
Comment

PREVIOUS NEXT
Code Example
Python :: en_core_web_sm 
Python :: pandas date range 
Python :: strftime 
Python :: plotly graph object colorscale 
Python :: print out a name in python 
Python :: how to run pyttsx3 in a loop 
Python :: making a virtual environment python 
Python :: python order by date 
Python :: windows 10 reset django migrations 
Python :: one line if statement without else 
Python :: give a function a name python 
Python :: pandas select first within groupby 
Python :: append python 
Python :: python show charracter code 
Python :: dt.weekday_name 
Python :: deleting models with sqlalchemy orm 
Python :: how to add phone number to django user model 
Python :: remove character(s)from each column in dataframe 
Python :: how to know the python pip module version 
Python :: python tic tac toe 
Python :: convert timestamp to date python 
Python :: python find difference between lists 
Python :: numpy average 
Python :: finding path of a module in python 
Python :: what does json.loads do 
Python :: python dictionary dynamic key 
Python :: pygame get keypress code 
Python :: import get user model django 
Python :: python sort the values in a dictionaryi 
Python :: How to create DataFrames 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =