Python - Network Interface Last Updated : 24 Nov, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Network interface is nothing but interconnection between two hardware equipment or protocol layers in a computer network. A network interface usually has some form of the network address. It is generally a network interface card that does not have any physical existence. It can be implemented in a software interface. It is difficult to keep track of interface names, status, or any other information related to them when we have multiple interfaces. For this purpose, Python has a library called netifaces which can list the interfaces and their status. The netifaces module is a portable third-party library which enumerates the network interfaces on the local machine. Below is a simple example using python netifaces module giving details of interfaces and their status. Installation: pip install netifaces Implementation of netifaces module for various network operations: Python3 # Import libraries import netifaces # Showing gateway list netifaces.gateways() # Getting interfaces interfaces = netifaces.interfaces() # Showing interfaces for interface in interfaces: print(interface) # Getting interface info print(netifaces.ifaddresses(str(interfaces[0]))) # Getting interface status addrs = netifaces.ifaddresses(str(interfaces[0])) print(addrs[netifaces.AF_INET]) print(addrs[netifaces.AF_LINK]) Output: Comment More infoAdvertise with us Next Article Internet of Things with Python J jeeteshgavande30 Follow Improve Article Tags : Technical Scripter Python Programming Language Technical Scripter 2020 Python-Networking +1 More Practice Tags : python Similar Reads Python-interface module In object-oriented languages like Python, the interface is a collection of method signatures that should be provided by the implementing class. Implementing an interface is a way of writing an organized code and achieve abstraction. The package zope.interface provides an implementation of "object in 3 min read Network Scanner in Python A network scanner is one major tool for analyzing the hosts that are available on the network. A network scanner is an IP scanner that is used for scanning the networks that are connected to several computers. To get the list of the available hosts on a network, there are two basic methods - ICMP Ec 3 min read Disadvantages of Python Python is a widely used general-purpose, high-level programming language. It is widely used by developers in various domains, from web development to Machine Learning. However, Python has its own set of advantages and disadvantages. Let's see some limitations of Python programming language. Cons of 3 min read Internet of Things with Python The integration of Python into the Internet of Things (IoT) signifies a transformation in how we develop, implement, and scale IoT applications. Python's simplicity, versatility, and robust library ecosystem make it an excellent choice for IoT development, enabling everything from simple home automa 8 min read Datagram in Python Datagram is a type of wireless communication between two endpoints and it requires the ip address and port number to establish connection. Datagram uses UDP(User Datagram Protocol), it converts user data into small packets or chunks of data so that it can be sent over a network in a continuous manne 2 min read Python Module Index Python has a vast ecosystem of modules and packages. These modules enable developers to perform a wide range of tasks without taking the headache of creating a custom module for them to perform a particular task. Whether we have to perform data analysis, set up a web server, or automate tasks, there 4 min read Like