Python 3 Display List of Installed Software on PC

0Shares

Today I’ll use Python 3 subprocess module to display a list of all the installed software on the computer. You can run the below code/script file in the command line to view the output.

code.py

# importing the module
import subprocess

# traverse the software list
Data = subprocess.check_output(['wmic', 'product', 'get', 'name'])
a = str(Data)

# try block
try:
  
  # arrange the string
  for i in range(len(a)):
    print(a.split("\\r\\r\\n")[6:][i])

except IndexError as e:
  print("All Done")

0Shares

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.