While working in a network, we do some troubleshooting with the network or Internet problem. This time we need to check your own system network connection information.
We can find the network connection in the Control Panel in Windows. The best way to find this information we can use ipconfig command in CMD. When you use ipconfig /all then you can get enough information to resolve your network problem.
We will use the subprocess module to interact with cmd and to retrieve information into your python ide. We can read the cmd command through the subprocess module.
- import module
- Get the output for the command “‘ipconfig’,’/all’ ” using subprocess.check_output()
- Now get the Split the string and arrange your data with your own needs.
Ifcfg module is a cross-platform (Windows/Unix) library for parsing ifconfig and ipconfig output in Python. It is useful for pulling information such as IP, Netmask, MAC Address, Hostname, etc.
pip install ifcfg
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- PyQtGraph – Getting Font Information of the Image View
- PyQtGraph – Getting View of Image View
- Important differences between Python 2.x and Python 3.x with examples
- Get Phone Number Information using Python
- Python - Get Hardware and System information using platform module
- Get Your System Information - Using Python Script
- Get latest Government job information using Python
- Build an GUI Application to Get Live Air Quality Information Using Python.
- How to get real-time Mutual Funds Information using Python?
- Create a GUI to search bank information with IFSC Code using Python
- Extract Author's information from Geeksforgeeks article using Python
- Create a GUI to Extract information from VIN number Using Python
- Complex Numbers in Python | Set 2 (Important Functions and Constants)
- Array in Python | Set 2 (Important Functions)
- Get all the information of a Collection's indexes using PyMongo
- Create a GUI to Get Domain Information Using Tkinter
- Scraping Amazon Product Information using Beautiful Soup
- Python IMDbPY – Series Information in XML format
- Python IMDbPY – Company Information in XML format
- Python IMDbPY – Person Information in XML format
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.