In this article, we are going to write a Python script to get the installed software list in windows. 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.
Let’s see the logic, if we run this wmic product get name code into our terminal then we got like this:
Let’s write the Python code to get installed software list information.
- Import the subprocess module.
- Get the output for the command “wmic product get name” using subprocess.check_output()
- Now split the string and arrange your data with your own needs.
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.