Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

cmd to get ip address python

pip install netifaces

################

from netifaces import interfaces, ifaddresses, AF_INET
for ifaceName in interfaces():
    addresses = [i['addr'] for i in ifaddresses(ifaceName).setdefault(AF_INET, [{'addr':'No IP addr'}] )]
    print '%s: %s' % (ifaceName, ', '.join(addresses))
Comment

PREVIOUS NEXT
Code Example
Python :: python enumerate unique values 
Python :: scikit tsne 
Python :: python sort a 2d array by custom function 
Python :: bmi calculator in python 
Python :: flask api with parameter 
Python :: seaborn boxplot multiple for each column 
Python :: pandas if python 
Python :: Add Cog to bot in Discord.py 
Python :: python list last element 
Python :: Flatten List in Python Using NumPy Reshape 
Python :: Link In Django 
Python :: how to call a python script from another python script 
Python :: word2vec python 
Python :: python track time 
Python :: python zip folder and subfolders 
Python :: Reverse an string Using Extended Slice Syntax in Python 
Python :: composition in python 
Python :: python check equality of floats 
Python :: python use variable name as variable 
Python :: python colored text into terminal 
Python :: pca 
Python :: Login script using Python and SQLite 
Python :: map a list to another list python 
Python :: python tkinter dynamic toggle button 
Python :: python enumerate 
Python :: sphinx autodoc command 
Python :: python find first occurrence in list 
Python :: python slice list 
Python :: django unique validator 
Python :: reverse python dictionary 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =